asyncio
New in version 2.0.
Scrapy has partial support asyncio
. After you install the asyncioreactor, you may use asyncio
andasyncio
-powered libraries in any coroutine.
Warning
asyncio
support in Scrapy is experimental. Future Scrapyversions may introduce related changes without a deprecationperiod or warning.
Installing the asyncio reactor
To enable asyncio
support, set the TWISTED_REACTOR
setting to'twisted.internet.asyncioreactor.AsyncioSelectorReactor'
.
If you are using CrawlerRunner
, you also need toinstall the AsyncioSelectorReactor
reactor manually. You can do that usinginstall_reactor()
:
- install_reactor('twisted.internet.asyncioreactor.AsyncioSelectorReactor')