Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set a finite navigation timeout with page.setDefaultNavigationTimeout(timeout_ms), then choose a completion condition that matches the page. For one exceptional navigation, pass timeout directly to goto(). Keep selector, function, request, and response waits on their own explicit timeouts: a navigation default does not configure every kind of wait.

Pyppeteer’s documented defaults for these operations are 30,000 milliseconds (30 seconds). Passing 0 disables the relevant timeout, but that should be an intentional decision rather than a reliability strategy.

Set a page-wide navigation timeout

Use this pattern when most navigations in a page should share one upper bound:

import asyncio
from pyppeteer import launch

async def main():
    browser = await launch()
    page = await browser.newPage()

    # Milliseconds: 60 seconds for goto, reload, back, forward,
    # and waitForNavigation.
    page.setDefaultNavigationTimeout(60_000)

    await page.goto(
        "https://example.com",
        {"waitUntil": "domcontentloaded"}
    )
    print(await page.title())
    await browser.close()

asyncio.get_event_loop().run_until_complete(main())

setDefaultNavigationTimeout() changes the default maximum for goto(), goBack(), goForward(), reload(), and waitForNavigation(). The argument is an integer number of milliseconds, not seconds. A value such as 60_000 is simply Python’s readable spelling for 60,000.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

There is no source-established duration that is reliable for every site, network, machine, or workload. Choose a finite bound based on what your job can wait, how variable the target pages are, and what recovery you want after a failure.

Override one navigation without changing the default

Pass a timeout in the options for an individual goto() when one page has different requirements:

await page.goto(
    "https://example.com/report",
    {
        "timeout": 120_000,
        "waitUntil": "domcontentloaded"
    }
)

This per-call value applies to that navigation. It is useful for a slow report page, while ordinary navigations continue to use the page-wide setting.

Conversely, a short per-call limit can protect a latency-sensitive operation even when the normal page default is longer:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.goto(
    "https://example.com/health",
    {"timeout": 10_000, "waitUntil": "load"}
)

If you need to disable the navigation limit for a call, use "timeout": 0. Do this only when an unbounded wait is acceptable and you have another way to stop the job; otherwise a stalled browser task can consume workers indefinitely.

Understand what “navigation complete” means

A timeout is measured against a completion condition. goto() supports these waitUntil choices:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Condition Meaning and practical use
load Wait for the page’s load event. Use when load-event completion is the contract your task needs.
domcontentloaded Wait until the initial document has been parsed. This can be appropriate when you only need the initial DOM and do not need every resource to finish.
networkidle0 Wait until there are no more than zero active network connections for at least 500 ms.
networkidle2 Wait until there are no more than two active network connections for at least 500 ms.

Network-idle conditions are not automatically “more reliable.” Analytics, polling, advertisements, WebSockets, and other background activity can keep requests open, so a page may never reach the selected idle state before the timeout. If the task only needs the initial document, domcontentloaded avoids waiting for unrelated background traffic.

For a single-page application, navigation completion may occur before the data or component you need exists. In that case, navigate to a suitable event and then wait for the actual application state:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.goto(
    "https://example.com/app",
    {"timeout": 45_000, "waitUntil": "domcontentloaded"}
)
await page.waitForSelector(
    "[data-testid='results']",
    {"timeout": 20_000}
)

This separates “the document arrived” from “the result widget appeared,” making failures easier to diagnose.

Configure the other waits separately

Navigation defaults are not universal wait defaults. The documented APIs for waitForSelector(), waitForFunction(), waitForRequest(), and waitForResponse() each accept their own timeout option. Their documented default is also 30 seconds, and 0 disables that individual wait’s limit.

Selector waits

await page.waitForSelector(
    "#checkout-complete",
    {"timeout": 15_000, "visible": True}
)

Use a selector timeout that reflects how long the UI is allowed to take, rather than extending navigation merely because a component renders late.

Function waits

await page.waitForFunction(
    "() => window.appReady === true",
    {"timeout": 15_000}
)

A predicate wait is appropriate when readiness is represented by state rather than a stable element.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Request and response waits

response = await page.waitForResponse(
    lambda response: "/api/results" in response.url,
    {"timeout": 20_000}
)

Give network waits their own bound. A page can finish navigation while the API request you care about is still pending.

Choose a timeout deliberately

  1. Define the operation. Decide whether you are bounding navigation, a DOM selector, a JavaScript predicate, or a request/response.
  2. Define the success condition. Select domcontentloaded, load, a network-idle condition, or a concrete selector/predicate.
  3. Set a finite default. Use setDefaultNavigationTimeout() for normal page behavior.
  4. Override exceptions. Pass a per-operation timeout where a particular page genuinely differs.
  5. Record the context. Log the URL, operation, timeout, and wait condition when an exception occurs.
  6. Retry only with a policy. A retry can help a transient network failure, but it should have a maximum count and should not turn every deterministic timeout into a long delay.

Complete example with bounded stages

import asyncio
from pyppeteer import launch

async def capture_ready_page(url):
    browser = await launch()
    page = await browser.newPage()
    page.setDefaultNavigationTimeout(30_000)

    try:
        await page.goto(url, {
            "timeout": 30_000,
            "waitUntil": "domcontentloaded"
        })
        await page.waitForSelector(
            "main",
            {"timeout": 10_000}
        )
        await page.waitForFunction(
            "() => document.readyState === 'complete'",
            {"timeout": 10_000}
        )
        return await page.content()
    finally:
        await browser.close()

async def main():
    html = await capture_ready_page("https://example.com")
    print(len(html))

asyncio.get_event_loop().run_until_complete(main())

The example keeps each stage bounded and closes the browser in finally, including when a timeout raises an exception. Adjust the selectors and readiness predicate to the application; they are not universal signals.

Diagnose a timeout before increasing it

The page is still making requests

Symptom: networkidle0 or networkidle2 expires while the page appears visible. Cause: background polling, analytics, streaming, or another persistent connection. Fix: use domcontentloaded or load for navigation, then wait for the specific selector or predicate your task requires.

The document loaded but the selector timed out

Symptom: goto() succeeds, but waitForSelector() fails. Cause: the selector is wrong, the element is inside a frame, the application reported an error, or rendering takes longer than the selector bound. Fix: verify the selector and frame context, inspect the page state, and change only the selector timeout if the condition is correct but legitimately slower.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A timeout occurs at exactly the configured duration

Symptom: failures consistently occur at 10,000, 30,000, or another exact value. Cause: the operation reached its configured bound. Fix: log which operation supplied that value; navigation, selector, function, request, and response waits are configured independently.

Setting the default did not affect a wait

Symptom: setDefaultNavigationTimeout() was called, but a selector or response still fails at its own default. Cause: the method changes navigation methods, not every wait API. Fix: provide timeout in the relevant wait call.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

The browser remains running after failure

Symptom: workers or Chromium processes accumulate. Cause: cleanup was skipped when an exception was raised. Fix: close the browser in a finally block and ensure your job runner also has an outer deadline.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Finite limits, retries, and performance

Longer timeouts do not make a page faster; they only allow a slow or stalled operation to occupy a worker longer. A short timeout can reject genuinely slow pages. Treat the value as an application budget: include expected network variance, rendering work, and any subsequent selector or request waits.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep navigation and post-navigation budgets visible separately. For example, a 30-second navigation limit followed by a 10-second selector limit has a different operational meaning from one 40-second navigation limit. This distinction helps capacity planning and tells you which stage needs attention.

When retrying, retry the smallest failed operation where possible. Repeating an entire navigation after a selector-only failure adds load and latency. Always cap retries and preserve the original timeout details in logs.

Version and environment checks

The API reference used for these semantics is explicitly for Pyppeteer 0.0.25, while the implementation reference is from the project’s dev branch. Your installed Pyppeteer release, Chromium revision, operating system, proxy, and target site can differ. Confirm subtle behavior against the version installed in your environment, especially when upgrading or relying on network-idle handling.

Do not assume behavior documented for current upstream Puppeteer automatically applies to Pyppeteer; they are related but versioned projects. Pin and record the versions used by your automation, and include the browser launch configuration when reproducing a timeout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Or skip the browser setup

If your goal is simply a reliable image or PDF of a URL, ScreenshotNeo provides a single HTTP request instead of managing Chromium and Pyppeteer timeouts. It accepts cookie or consent banners like a visitor, removes more than 60 known consent platforms plus newsletter popups and chat widgets before capture, and lets you turn each cleanup step off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and whether it was billed. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for the full option set, including wait conditions, custom headers and cookies, device presets, full-page capture, PDFs, CSS and JavaScript, caching, signed links, asynchronous jobs, and bulk capture.

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account.

Frequently Asked Questions

What unit does a Pyppeteer timeout use?

Milliseconds. For example, 30,000 means 30 seconds.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does setting a navigation timeout configure waitForSelector()?

No. Give selector, function, request, and response waits their own timeout options.

When should I use timeout 0?

Only when intentionally disabling the bound and another watchdog can stop a stuck operation.

Why can networkidle0 time out on a usable page?

The page may keep background connections open, preventing the required idle period.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.