Merge pull request #738 from chekunkov/downloader_setting

Downloader setting
This commit is contained in:
Daniel Graña 2014-06-03 09:36:53 -03:00
commit 2a42c1c62e
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'