diff --git a/scrapy_playwright/handler.py b/scrapy_playwright/handler.py index a0476fc..b1f69ad 100644 --- a/scrapy_playwright/handler.py +++ b/scrapy_playwright/handler.py @@ -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))