diff --git a/README.md b/README.md index c5368cc..3b6bf2b 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ SELENIUM_CAPABILITIES = DesiredCapabilities.CHROME # Example for Chrome # You need also to change the default download handlers, like so: DOWNLOAD_HANDLERS = { - "http": "scrapy_selenium.SeleniumDownloadHandler", - "https": "scrapy_selenium.SeleniumDownloadHandler", + "http": "scrapy_headless.HeadlessDownloadHandler", + "https": "scrapy_headless.HeadlessDownloadHandler", } ``` diff --git a/scrapy_headless/downloader.py b/scrapy_headless/downloader.py index 53a5bcb..f585b62 100644 --- a/scrapy_headless/downloader.py +++ b/scrapy_headless/downloader.py @@ -87,3 +87,7 @@ def get_driver(self, spider): self._drivers.add(driver) self._data.driver = driver return driver + + @classmethod + def from_crawler(cls, crawler): + return cls(crawler.settings) diff --git a/setup.py b/setup.py index c3b9806..8a263d2 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="scrapy-headless", - version="0.0.1", + version="0.0.2", license="BSD", description="Download Handler for using Scrapy with headless browsers", maintainer="Henrique Coura",