MCPcopy
hub / github.com/scrapy/scrapy / __init__

Method __init__

scrapy/core/downloader/handlers/http11.py:86–104  ·  view source on GitHub ↗
(self, crawler: Crawler)

Source from the content-addressed store, hash-verified

84
85class HTTP11DownloadHandler(BaseHttpDownloadHandler):
86 def __init__(self, crawler: Crawler):
87 if not crawler.settings.getbool("TWISTED_REACTOR_ENABLED"):
88 raise NotConfigured(f"{type(self).__name__} requires a Twisted reactor.")
89 super().__init__(crawler)
90 self._crawler = crawler
91
92 from twisted.internet import reactor
93
94 self._pool: HTTPConnectionPool = HTTPConnectionPool(reactor, persistent=True)
95 self._pool.maxPersistentPerHost = crawler.settings.getint(
96 "CONCURRENT_REQUESTS_PER_DOMAIN"
97 )
98 self._pool._factory.noisy = False
99
100 self._contextFactory: IPolicyForHTTPS = _load_context_factory_from_settings(
101 crawler
102 )
103 self._bind_address = crawler.settings.get("DOWNLOAD_BIND_ADDRESS")
104 self._disconnect_timeout: int = 1
105
106 async def download_request(self, request: Request) -> Response:
107 """Return a deferred for the HTTP download"""

Callers

nothing calls this directly

Calls 6

NotConfiguredClass · 0.90
getintMethod · 0.80
getboolMethod · 0.45
__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected