You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to access the playwright cookies in the callback without passing the page itself ? it can be accessed by storing into global variable but that could cause issues in case of multiple pages.
It would be very useful to have the page cookies in the callback.
def start_requests(self) -> Iterable[Request]:
url = "https://corp.sec.state.ma.us/CorpWeb/CorpSearch/CorpSearch.aspx"
yield scrapy.Request(url, callback=self.parse, meta={
"playwright": True,
"playwright_page_methods": [
PageMethod(self.init_session)
]
})
async def init_session(self, page: Page) -> None:
cookies = await page.context.cookies()
return cookies
def parse(self, response: Response):
# how to access playwright cookies here,
pass
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Is it possible to access the playwright cookies in the callback without passing the page itself ? it can be accessed by storing into global variable but that could cause issues in case of multiple pages.
It would be very useful to have the page cookies in the callback.
The text was updated successfully, but these errors were encountered: