Scrapy, a fast high-level web crawling & scraping framework for Python.
Minor refactor in the docs and functions used in the shell command
Julia Medina6339864f95d4
diff --git a/scrapy/commands/shell.py b/scrapy/commands/shell.pyindex e4d32c314..e2ef1545e 100644--- a/scrapy/commands/shell.py+++ b/scrapy/commands/shell.py@@ -50,11 +50,15 @@ class Command(ScrapyCommand):elif url:spidercls = spidercls_for_request(spiders, Request(url),spidercls, log_multiple=True)++ # The crawler is created this way since the Shell manually handles the+ # crawling engine, so the set up in the crawl method won't workcrawler = self.crawler_process._create_logged_crawler(spidercls)+ # The Shell class needs a persistent engine in the crawlercrawler.engine = crawler._create_engine()crawler.engine.start()- self.crawler_process._start_logging()+ self.crawler_process.start(start_reactor=False)self._start_crawler_thread()shell = Shell(crawler, update_vars=self.update_vars, code=opts.code)diff --git a/scrapy/crawler.py b/scrapy/crawler.pyindex 52e57fe83..e0524021a 100644--- a/scrapy/crawler.py+++ b/scrapy/crawler.py@@ -126,13 +126,11 @@ class CrawlerProcess(CrawlerRunner):self._stop_logging()reactor.callFromThread(self._stop_reactor)- def start(self, stop_after_crawl=True):- self._start_logging()- self._start_reactor(stop_after_crawl)-- def _start_logging(self):+ def start(self, stop_after_crawl=True, start_reactor=True):self.log_observer = log.start_from_settings(self.settings)log.scrapy_info(self.settings)+ if start_reactor:+ self._start_reactor(stop_after_crawl)def _start_reactor(self, stop_after_crawl=True):if stop_after_crawl: