Skip to content

Commit 63c1fe9

Browse files
authored
Remove bad page init callback code (#222)
1 parent e0f3b61 commit 63c1fe9

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

scrapy_playwright/handler.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -212,27 +212,6 @@ async def _create_page(self, request: Request, spider: Spider) -> Page:
212212
self._set_max_concurrent_page_count()
213213
if self.default_navigation_timeout is not None:
214214
page.set_default_navigation_timeout(self.default_navigation_timeout)
215-
page_init_callback = request.meta.get("playwright_page_init_callback")
216-
if page_init_callback:
217-
try:
218-
page_init_callback = load_object(page_init_callback)
219-
await page_init_callback(page, request)
220-
except Exception as ex:
221-
logger.warning(
222-
"[Context=%s] Page init callback exception for %s exc_type=%s exc_msg=%s",
223-
context_name,
224-
repr(request),
225-
type(ex),
226-
str(ex),
227-
extra={
228-
"spider": spider,
229-
"context_name": context_name,
230-
"scrapy_request_url": request.url,
231-
"scrapy_request_method": request.method,
232-
"exception": ex,
233-
},
234-
exc_info=True,
235-
)
236215

237216
page.on("close", self._make_close_page_callback(context_name))
238217
page.on("crash", self._make_close_page_callback(context_name))

0 commit comments

Comments
 (0)