File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -982,6 +982,37 @@ async def main():
982982asyncio.run(main())
983983```
984984
985+ ### Reproducible code example
986+
987+ When opening an issue please include a
988+ [ Minimal, Reproducible Example] ( https://stackoverflow.com/help/minimal-reproducible-example )
989+ that shows the reported behavior. In addition, please make the code as self-contained as possible
990+ so an active Scrapy project is not required and the spider can be executed directly from a file with
991+ [ ` scrapy runspider ` ] ( https://docs.scrapy.org/en/latest/topics/commands.html#std-command-runspider ) .
992+ This usually means including the relevant settings in the spider's
993+ [ ` custom_settings ` ] ( https://docs.scrapy.org/en/latest/topics/settings.html#settings-per-spider )
994+ attribute:
995+
996+ ``` python
997+ import scrapy
998+
999+ class ExampleSpider (scrapy .Spider ):
1000+ name = " example"
1001+ custom_settings = {
1002+ " TWISTED_REACTOR" : " twisted.internet.asyncioreactor.AsyncioSelectorReactor" ,
1003+ " DOWNLOAD_HANDLERS" : {
1004+ " https" : " scrapy_playwright.handler.ScrapyPlaywrightDownloadHandler" ,
1005+ " http" : " scrapy_playwright.handler.ScrapyPlaywrightDownloadHandler" ,
1006+ },
1007+ }
1008+
1009+ def start_requests (self ):
1010+ yield scrapy.Request(
1011+ url = " https://example.org" ,
1012+ meta = {" playwright" : True },
1013+ )
1014+ ```
1015+
9851016
9861017## Frequently Asked Questions
9871018
You can’t perform that action at this time.
0 commit comments