v0.6.4
Added
- Auto-patch for
nodriverencoding bug
scrapy_stealth.utils.patch.patch_nodriver()is now called automatically when the browser
engine is first imported. It detects and fixes the Latin-1 byte (\xb1) in
nodriver/cdp/network.pythat causes aSyntaxErroron Python 3 without an encoding
declaration. The patch is re-applied after everypip install --upgrade nodriverwithout
any manual intervention required.
Fixed
StealthTimeoutErrorcompatibility with Scrapy < 2.15
scrapy.exceptions.DownloadTimeoutErrorwas added in Scrapy 2.15. Importing it directly
caused anImportErroron older Scrapy versions (e.g. 2.12–2.14).StealthTimeoutError
now falls back toTimeoutErroras its base class whenDownloadTimeoutErroris not
available, keeping full compatibility across all supported Scrapy versions.
Changed
-
Shorter middleware import path
StealthDownloaderMiddlewareis now importable directly from the top-level package:DOWNLOADER_MIDDLEWARES = { "scrapy_stealth.StealthDownloaderMiddleware": 950, }
The full path
scrapy_stealth.middlewares.stealth.StealthDownloaderMiddlewarestill works
for backwards compatibility.