MCPcopy Create free account
hub / github.com/apify/crawlee-python / _execute_hooks

Method _execute_hooks

src/crawlee/browsers/_browser_pool.py:395–398  ·  view source on GitHub ↗

Execute the provided hooks with the given arguments.

(self, hooks: list[Callable[..., Awaitable[None]]], *args: Any)

Source from the content-addressed store, hash-verified

393 self._inactive_browsers.remove(browser)
394
395 async def _execute_hooks(self, hooks: list[Callable[..., Awaitable[None]]], *args: Any) -> None:
396 """Execute the provided hooks with the given arguments."""
397 for hook in hooks:
398 await hook(*args)
399
400 def _override_page_close(self, crawlee_page: CrawleePage, browser_controller: BrowserController) -> None:
401 """Override the page's close method to execute pre and post close hooks."""

Callers 3

_get_new_pageMethod · 0.95
_launch_new_browserMethod · 0.95
close_with_hooksMethod · 0.95

Calls 1

hookFunction · 0.50

Tested by

no test coverage detected