Skip to main content
  • Without AI Loading Detection
  • With AI Loading Detection
async def go_to_url(
    page: Page,
    url: str,
    *,
    timeout_s: int = 30,
    retries: int = 3,
    wait_for_load_state: Literal['commit', 'domcontentloaded', 'load', 'networkidle'] = 'load',
    throw_on_timeout: bool = True,
    wait_for_load_using_ai: Literal[False] = False,
) -> None
Navigates to a specified URL with enhanced reliability features including automatic retries with exponential backoff, intelligent timeout detection, and smart waiting strategies.This function handles common navigation challenges by automatically retrying failed requests, detecting navigation hangs, and ensuring the page reaches a truly idle state using standard Playwright load state detection. The function can be configured to either throw errors or gracefully continue execution when navigation issues occur.

Examples

from intuned_browser import go_to_url
async def automation(page, params, **_kwargs):
    await go_to_url(page, 'https://example.com')

Arguments

page
Page
required
The Playwright Page object to navigate.
url
str
required
The URL to navigate to.
timeout_s
int
default:"30"
Maximum navigation time in seconds. Defaults to 30.
retries
int
default:"3"
Number of retry attempts with exponential backoff (factor: 2). Defaults to 3.
wait_for_load_state
Literal['load', 'domcontentloaded', 'networkidle', 'commit']
default:"'load'"
When to consider navigation succeeded. Defaults to “load”.
throw_on_timeout
bool
default:"True"
Whether to raise an error on navigation timeout. When False, the function returns without throwing, allowing continued execution. Defaults to True.
wait_for_load_using_ai
bool
default:"False"
Set to False to disable AI-powered loading checks. Defaults to False.

Returns: None

Function completes when navigation is finished or fails after retries.