@@ -98,7 +98,7 @@ class AwesomeSpider(scrapy.Spider):
9898 meta = {" playwright" : True },
9999 )
100100
101- def parse (self , response ):
101+ def parse (self , response , ** kwargs ):
102102 # 'response' contains the page as seen by the browser
103103 return {" url" : response.url}
104104```
@@ -430,7 +430,7 @@ def start_requests(self):
430430 meta = {" playwright" : True , " playwright_include_page" : True },
431431 )
432432
433- def parse (self , response ):
433+ def parse (self , response , ** kwargs ):
434434 page = response.meta[" playwright_page" ]
435435 yield scrapy.Request(
436436 url = " https://httpbin.org/headers" ,
@@ -467,7 +467,7 @@ about the give response. Only available for HTTPS requests. Could be accessed
467467in the callback via ` response.meta['playwright_security_details'] `
468468
469469``` python
470- def parse (self , response ):
470+ def parse (self , response , ** kwargs ):
471471 print (response.meta[" playwright_security_details" ])
472472 # {'issuer': 'DigiCert TLS RSA SHA256 2020 CA1', 'protocol': 'TLS 1.3', 'subjectName': 'www.example.org', 'validFrom': 1647216000, 'validTo': 1678838399}
473473```
@@ -609,7 +609,7 @@ you can access a context though the corresponding [`Page.context`](https://playw
609609attribute, and await [ ` close ` ] ( https://playwright.dev/python/docs/api/class-browsercontext#browser-context-close ) on it.
610610
611611``` python
612- def parse (self , response ):
612+ def parse (self , response , ** kwargs ):
613613 yield scrapy.Request(
614614 url = " https://example.org" ,
615615 callback = self .parse_in_new_context,
@@ -672,7 +672,7 @@ class ProxySpider(Spider):
672672 def start_requests (self ):
673673 yield Request(" http://httpbin.org/get" , meta = {" playwright" : True })
674674
675- def parse (self , response ):
675+ def parse (self , response , ** kwargs ):
676676 print (response.text)
677677```
678678
@@ -741,7 +741,7 @@ def start_requests(self):
741741 },
742742 )
743743
744- def parse (self , response ):
744+ def parse (self , response , ** kwargs ):
745745 screenshot = response.meta[" playwright_page_methods" ][0 ]
746746 # screenshot.result contains the image's bytes
747747```
@@ -754,7 +754,7 @@ def start_requests(self):
754754 meta = {" playwright" : True , " playwright_include_page" : True },
755755 )
756756
757- async def parse (self , response ):
757+ async def parse (self , response , ** kwargs ):
758758 page = response.meta[" playwright_page" ]
759759 screenshot = await page.screenshot(path = " example.png" , full_page = True )
760760 # screenshot contains the image's bytes
@@ -846,7 +846,7 @@ class ClickAndSavePdfSpider(scrapy.Spider):
846846 ),
847847 )
848848
849- def parse (self , response ):
849+ def parse (self , response , ** kwargs ):
850850 pdf_bytes = response.meta[" playwright_page_methods" ][" pdf" ].result
851851 with open (" iana.pdf" , " wb" ) as fp:
852852 fp.write(pdf_bytes)
@@ -873,7 +873,7 @@ class ScrollSpider(scrapy.Spider):
873873 ),
874874 )
875875
876- async def parse (self , response ):
876+ async def parse (self , response , ** kwargs ):
877877 page = response.meta[" playwright_page" ]
878878 await page.screenshot(path = " quotes.png" , full_page = True )
879879 await page.close()
0 commit comments