Archived
This project has been archived by its maintainers, and is no longer receiving any updates.
scrapy-aiohttp-downloader
scrapy-aiohttp-downloader is a Scrapy download handler.
Installation
pip install scrapy-aiohttp-downloader
Activation
Replace the default http and/or https Download Handlers through DOWNLOAD_HANDLERS
DOWNLOAD_HANDLERS = {
"http": "scrapy_aiohttp_downloader.AioHTTPDownloadHandler",
"https": "scrapy_aiohttp_downloader.AioHTTPDownloadHandler",
}
Also, be sure to install the asyncio-based Twisted reactor:
TWISTED_REACTOR = "twisted.internet.asyncioreactor.AsyncioSelectorReactor"
Basic usage
Set the aiohttp Request.meta key to download a request using aiohttp:
import scrapy
class AioHTTPSpider(scrapy.Spider):
name = "spider"
custom_settings = {
"DOWNLOAD_HANDLERS": {
"http": "scrapy_aiohttp_downloader.AioHTTPDownloadHandler",
"https": "scrapy_aiohttp_downloader.AioHTTPDownloadHandler",
},
"TWISTED_REACTOR": "twisted.internet.asyncioreactor.AsyncioSelectorReactor",
}
def start_requests(self):
yield scrapy.Request(
"https://example.com/",
meta={"aiohttp": True},
)
Release files for scrapy-aiohttp-downloader 1.0.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scrapy_aiohttp_downloader-1.0.0b2.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scrapy_aiohttp_downloader-1.0.0b2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / scrapy_aiohttp_downloader-1.0.0b2.tar.gz
| Download URL | scrapy_aiohttp_downloader-1.0.0b2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7938f0f3be72ceed694de5a00301c8cbe2d4657989cdaad489c7c929c60a2b6f
|
|
BLAKE2b-256 checksum How to use checksums |
6632ddc0273aa28eb0a385d44e6faadd3521d3df3358b9c173773e3e2d75f290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / scrapy_aiohttp_downloader-1.0.0b2-py3-none-any.whl
| Download URL | scrapy_aiohttp_downloader-1.0.0b2-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0fb34c1c190943204b0ebd31daa01b6dbbf7b4c5f03f5217c7af20b78645b44
|
|
BLAKE2b-256 checksum How to use checksums |
afcf450ce77ef1ea711ac68077f14c3b9c9c7a345d055242d47d8c49347bf49a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|