2.0
Scrapy has partial support asyncio
. After you install the asyncio
reactor <install-asyncio>
, you may use asyncio
and asyncio
-powered libraries in any coroutine <coroutines>
.
Warning
asyncio
support in Scrapy is experimental. Future Scrapy versions may introduce related changes without a deprecation period or warning.
To enable asyncio
support, set the TWISTED_REACTOR
setting to 'twisted.internet.asyncioreactor.AsyncioSelectorReactor'
.
If you are using ~scrapy.crawler.CrawlerRunner
, you also need to install the ~twisted.internet.asyncioreactor.AsyncioSelectorReactor
reactor manually. You can do that using ~scrapy.utils.reactor.install_reactor
:
install_reactor('twisted.internet.asyncioreactor.AsyncioSelectorReactor')