Skip to content

Commit

Permalink
Remove bad page init callback code
Browse files Browse the repository at this point in the history
  • Loading branch information
elacuesta committed Aug 16, 2023
1 parent e0f3b61 commit 1b84033
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions scrapy_playwright/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,27 +212,6 @@ async def _create_page(self, request: Request, spider: Spider) -> Page:
self._set_max_concurrent_page_count()
if self.default_navigation_timeout is not None:
page.set_default_navigation_timeout(self.default_navigation_timeout)
page_init_callback = request.meta.get("playwright_page_init_callback")
if page_init_callback:
try:
page_init_callback = load_object(page_init_callback)
await page_init_callback(page, request)
except Exception as ex:
logger.warning(
"[Context=%s] Page init callback exception for %s exc_type=%s exc_msg=%s",
context_name,
repr(request),
type(ex),
str(ex),
extra={
"spider": spider,
"context_name": context_name,
"scrapy_request_url": request.url,
"scrapy_request_method": request.method,
"exception": ex,
},
exc_info=True,
)

page.on("close", self._make_close_page_callback(context_name))
page.on("crash", self._make_close_page_callback(context_name))
Expand Down

0 comments on commit 1b84033

Please sign in to comment.