File tree Expand file tree Collapse file tree 4 files changed +6
-3
lines changed
docs/02_guides/code/scrapy_project/src Expand file tree Collapse file tree 4 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- from twisted . internet import asyncioreactor
3+ from scrapy . utils . reactor import install_reactor
44
55# Install Twisted's asyncio reactor before importing any other Twisted or
66# Scrapy components.
7- asyncioreactor .install () # type: ignore[no-untyped-call]
7+ install_reactor ( 'twisted.internet. asyncioreactor.AsyncioSelectorReactor' )
88
99import os
1010
Original file line number Diff line number Diff line change 55ROBOTSTXT_OBEY = True
66SPIDER_MODULES = ['src.spiders' ]
77TELNETCONSOLE_ENABLED = False
8+ # Do not change the Twisted reactor unless you really know what you are doing.
89TWISTED_REACTOR = 'twisted.internet.asyncioreactor.AsyncioSelectorReactor'
Original file line number Diff line number Diff line change 11from .title import TitleSpider
2+
3+ __all__ = ['TitleSpider' ]
Original file line number Diff line number Diff line change 1010if TYPE_CHECKING :
1111 from collections .abc import Generator
1212
13- from scrapy .responsetypes import Response
13+ from scrapy .http . response import Response
1414
1515
1616class TitleSpider (Spider ):
You can’t perform that action at this time.
0 commit comments