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 1
1
from __future__ import annotations
2
2
3
- from twisted . internet import asyncioreactor
3
+ from scrapy . utils . reactor import install_reactor
4
4
5
5
# Install Twisted's asyncio reactor before importing any other Twisted or
6
6
# Scrapy components.
7
- asyncioreactor .install () # type: ignore[no-untyped-call]
7
+ install_reactor ( 'twisted.internet. asyncioreactor.AsyncioSelectorReactor' )
8
8
9
9
import os
10
10
Original file line number Diff line number Diff line change 5
5
ROBOTSTXT_OBEY = True
6
6
SPIDER_MODULES = ['src.spiders' ]
7
7
TELNETCONSOLE_ENABLED = False
8
+ # Do not change the Twisted reactor unless you really know what you are doing.
8
9
TWISTED_REACTOR = 'twisted.internet.asyncioreactor.AsyncioSelectorReactor'
Original file line number Diff line number Diff line change 1
1
from .title import TitleSpider
2
+
3
+ __all__ = ['TitleSpider' ]
Original file line number Diff line number Diff line change 10
10
if TYPE_CHECKING :
11
11
from collections .abc import Generator
12
12
13
- from scrapy .responsetypes import Response
13
+ from scrapy .http . response import Response
14
14
15
15
16
16
class TitleSpider (Spider ):
You can’t perform that action at this time.
0 commit comments