File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -76,15 +76,14 @@ requests will be processed by the regular Scrapy download handler.
76
76
77
77
### Twisted reactor
78
78
79
- When running on GNU/Linux or macOS you'll need to
80
- [ install the ` asyncio ` -based Twisted reactor] ( https://docs.scrapy.org/en/latest/topics/asyncio.html#installing-the-asyncio-reactor ) :
79
+ [ Install the ` asyncio ` -based Twisted reactor] ( https://docs.scrapy.org/en/latest/topics/asyncio.html#installing-the-asyncio-reactor ) :
81
80
82
81
``` python
83
82
# settings.py
84
83
TWISTED_REACTOR = " twisted.internet.asyncioreactor.AsyncioSelectorReactor"
85
84
```
86
85
87
- This is not a requirement on Windows (see [ Windows support ] ( #windows-support ) )
86
+ This is the default in new projects since [ Scrapy 2.7 ] ( https://github.com/scrapy/scrapy/releases/tag/2.7.0 ) .
88
87
89
88
90
89
## Basic usage
Original file line number Diff line number Diff line change 1
1
import asyncio
2
2
import logging
3
- import platform
4
3
from contextlib import suppress
5
4
from dataclasses import dataclass , field as dataclass_field
6
5
from ipaddress import ip_address
@@ -132,8 +131,7 @@ class ScrapyPlaywrightDownloadHandler(HTTPDownloadHandler):
132
131
def __init__ (self , crawler : Crawler ) -> None :
133
132
super ().__init__ (settings = crawler .settings , crawler = crawler )
134
133
_ThreadedLoopAdapter .start ()
135
- if platform .system () != "Windows" :
136
- verify_installed_reactor ("twisted.internet.asyncioreactor.AsyncioSelectorReactor" )
134
+ verify_installed_reactor ("twisted.internet.asyncioreactor.AsyncioSelectorReactor" )
137
135
crawler .signals .connect (self ._engine_started , signals .engine_started )
138
136
self .stats = crawler .stats
139
137
You can’t perform that action at this time.
0 commit comments