Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/crawlee/crawlers/_playwright/_playwright_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ class _PlaywrightCrawlerAdditionalOptions(TypedDict):
headless: NotRequired[bool]
"""Whether to run the browser in headless mode. This option should not be used if `browser_pool` is provided."""

navigation_timeout: NotRequired[timedelta]
"""Timeout for navigation (the process between opening a Playwright page and calling the request handler)."""


class PlaywrightCrawlerOptions(
_PlaywrightCrawlerAdditionalOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,11 @@ async def test_adaptive_playwright_crawler_timeout_in_sub_crawler(test_urls: lis
max_request_retries=0,
rendering_type_predictor=static_only_predictor_no_detection,
request_handler_timeout=request_handler_timeout,
# The fallback browser request navigates under its own `navigation_timeout` budget, separate from
# the request handler timeout relaxed in the handler below. Give it the same generous ceiling:
# with `max_request_retries=0`, a single navigation slower than the default budget on a loaded CI
# runner would fail the only attempt before the handler ever runs.
playwright_crawler_specific_kwargs={'navigation_timeout': timedelta(seconds=120)},
)
mocked_static_handler = Mock(name='static_handler')
mocked_browser_handler = Mock(name='browser_handler')
Expand Down
Loading