DOWNLOADER setting

This commit is contained in:
Alexander Chekunkov 2014-06-02 13:05:22 +03:00
parent 156d347c00
commit 1fba64d34e
3 changed files with 13 additions and 1 deletions

View File

@ -279,6 +279,15 @@ Default: ``True``
Whether to enable DNS in-memory cache.
.. setting:: DOWNLOADER
DOWNLOADER
---------
Default: ``'scrapy.core.downloader.Downloader'``
The downloader to use for crawling.
.. setting:: DOWNLOADER_MIDDLEWARES
DOWNLOADER_MIDDLEWARES

View File

@ -60,7 +60,8 @@ class ExecutionEngine(object):
self.running = False
self.paused = False
self.scheduler_cls = load_object(self.settings['SCHEDULER'])
self.downloader = Downloader(crawler)
downloader_cls = load_object(self.settings['DOWNLOADER'])
self.downloader = downloader_cls(crawler)
self.scraper = Scraper(crawler)
self._concurrent_spiders = self.settings.getint('CONCURRENT_SPIDERS', 1)
if self._concurrent_spiders != 1:

View File

@ -66,6 +66,8 @@ DOWNLOAD_HANDLERS_BASE = {
DOWNLOAD_TIMEOUT = 180 # 3mins
DOWNLOADER = 'scrapy.core.downloader.Downloader'
DOWNLOADER_HTTPCLIENTFACTORY = 'scrapy.core.downloader.webclient.ScrapyHTTPClientFactory'
DOWNLOADER_CLIENTCONTEXTFACTORY = 'scrapy.core.downloader.contextfactory.ScrapyClientContextFactory'