@@ -98,7 +98,7 @@ class AwesomeSpider(scrapy.Spider):
98
98
meta = {" playwright" : True },
99
99
)
100
100
101
- def parse (self , response ):
101
+ def parse (self , response , ** kwargs ):
102
102
# 'response' contains the page as seen by the browser
103
103
return {" url" : response.url}
104
104
```
@@ -430,7 +430,7 @@ def start_requests(self):
430
430
meta = {" playwright" : True , " playwright_include_page" : True },
431
431
)
432
432
433
- def parse (self , response ):
433
+ def parse (self , response , ** kwargs ):
434
434
page = response.meta[" playwright_page" ]
435
435
yield scrapy.Request(
436
436
url = " https://httpbin.org/headers" ,
@@ -467,7 +467,7 @@ about the give response. Only available for HTTPS requests. Could be accessed
467
467
in the callback via ` response.meta['playwright_security_details'] `
468
468
469
469
``` python
470
- def parse (self , response ):
470
+ def parse (self , response , ** kwargs ):
471
471
print (response.meta[" playwright_security_details" ])
472
472
# {'issuer': 'DigiCert TLS RSA SHA256 2020 CA1', 'protocol': 'TLS 1.3', 'subjectName': 'www.example.org', 'validFrom': 1647216000, 'validTo': 1678838399}
473
473
```
@@ -609,7 +609,7 @@ you can access a context though the corresponding [`Page.context`](https://playw
609
609
attribute, and await [ ` close ` ] ( https://playwright.dev/python/docs/api/class-browsercontext#browser-context-close ) on it.
610
610
611
611
``` python
612
- def parse (self , response ):
612
+ def parse (self , response , ** kwargs ):
613
613
yield scrapy.Request(
614
614
url = " https://example.org" ,
615
615
callback = self .parse_in_new_context,
@@ -672,7 +672,7 @@ class ProxySpider(Spider):
672
672
def start_requests (self ):
673
673
yield Request(" http://httpbin.org/get" , meta = {" playwright" : True })
674
674
675
- def parse (self , response ):
675
+ def parse (self , response , ** kwargs ):
676
676
print (response.text)
677
677
```
678
678
@@ -741,7 +741,7 @@ def start_requests(self):
741
741
},
742
742
)
743
743
744
- def parse (self , response ):
744
+ def parse (self , response , ** kwargs ):
745
745
screenshot = response.meta[" playwright_page_methods" ][0 ]
746
746
# screenshot.result contains the image's bytes
747
747
```
@@ -754,7 +754,7 @@ def start_requests(self):
754
754
meta = {" playwright" : True , " playwright_include_page" : True },
755
755
)
756
756
757
- async def parse (self , response ):
757
+ async def parse (self , response , ** kwargs ):
758
758
page = response.meta[" playwright_page" ]
759
759
screenshot = await page.screenshot(path = " example.png" , full_page = True )
760
760
# screenshot contains the image's bytes
@@ -846,7 +846,7 @@ class ClickAndSavePdfSpider(scrapy.Spider):
846
846
),
847
847
)
848
848
849
- def parse (self , response ):
849
+ def parse (self , response , ** kwargs ):
850
850
pdf_bytes = response.meta[" playwright_page_methods" ][" pdf" ].result
851
851
with open (" iana.pdf" , " wb" ) as fp:
852
852
fp.write(pdf_bytes)
@@ -873,7 +873,7 @@ class ScrollSpider(scrapy.Spider):
873
873
),
874
874
)
875
875
876
- async def parse (self , response ):
876
+ async def parse (self , response , ** kwargs ):
877
877
page = response.meta[" playwright_page" ]
878
878
await page.screenshot(path = " quotes.png" , full_page = True )
879
879
await page.close()
0 commit comments