October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Puppeteer goto() Options Explained: Waiting, Timeouts, and Responses

A practical guide to Puppeteer page.goto(): choose waitUntil conditions, set timeouts, wait for app-specific readiness, and inspect HTTP responses safely.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

page.goto(url, options) navigates a Puppeteer page or frame to a URL. Its options control when Puppeteer considers the navigation wait complete, how long to wait, whether it can be cancelled, and what referrer information to use. Check the returned response when HTTP status matters: a resolved navigation does not necessarily mean the server returned a successful status.

What page.goto() does and returns

The documented signature is page.goto(url: string, options?: GoToOptions): Promise<HTTPResponse | null>. Include a scheme such as https:// in the URL. On a redirect chain, the resolved response represents the final redirect, not an earlier response. Navigation to about:blank or to the same URL with only a hash change can resolve to null, so handle the possibility that no response object is returned. Puppeteer Page.goto() reference

As an Amazon Associate I earn from qualifying purchases.

A fulfilled navigation promise is not equivalent to an HTTP 2xx response. Where your task depends on the status, inspect the response. In headless shell, documented valid HTTP status codes such as 404 and 500 do not cause goto() to throw.

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

Options accepted by goto()

GoToOptions extends WaitForOptions, so it combines navigation waiting controls with referrer-related options. Confirm the API against the Puppeteer version installed in your project: the official references used here identify Page and WaitForOptions as version 25.12.0 and GoToOptions as 25.10.0.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Option What it controls Documented behavior
waitUntil Which navigation lifecycle condition or conditions must occur before the wait succeeds. Defaults to 'load'. An array requires every listed event to fire.
timeout Maximum wait time for this call, in milliseconds. Defaults to 30000. Set to 0 to disable the timeout.
signal Cancellation of the call. Accepts an AbortSignal.
referer Referrer value for the navigation. If set, it takes precedence over the referer header configured with page.setExtraHTTPHeaders().
referrerPolicy Referrer policy for the navigation. Listed as an optional GoToOptions property; use a policy appropriate to your request.

Sources: WaitForOptions and GoToOptions.

Choose the wait condition for the job

Wait for a navigation lifecycle event

Use waitUntil when the condition you care about is a browser navigation lifecycle milestone. The default, 'load', waits for the load event. You can specify an array when all listed lifecycle events must occur; this can take longer because none of the listed conditions is optional.

const response = await page.goto('https://example.com', {
  waitUntil: 'domcontentloaded',
  timeout: 30000,
});

Choose a lifecycle condition that matches the work that follows. It does not establish that a particular application widget has rendered or that client-side data has loaded.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Wait for an application element or state

If your next step requires a specific element, wait for that selector after navigation rather than treating a lifecycle event as proof of application readiness. page.waitForSelector() resolves when the selector appears and supports visible or hidden conditions. Puppeteer waitForSelector() reference

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.goto('https://example.com/dashboard', {
  waitUntil: 'domcontentloaded',
});
await page.waitForSelector('[data-testid="dashboard-ready"]', {
  visible: true,
});

Replace the selector with one that reflects the actual condition your script needs. A selector wait is more directly tied to that condition than waiting for a generic navigation milestone.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Wait for network activity only when that is the condition you need

page.waitForNetworkIdle() is a separate wait. It waits at least the configured idle time, but network idleness and application readiness are not interchangeable: a page can be idle before the desired UI state is available, or keep making requests after the useful interface has appeared. Puppeteer waitForNetworkIdle() reference

Synchronize clicks that trigger navigation

When a click causes navigation, start waiting for that navigation and perform the click together. Waiting only after the click risks missing the navigation event. Puppeteer’s Page reference shows the synchronized Promise.all() pattern. Puppeteer Page reference

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
const [response] = await Promise.all([
  page.waitForNavigation({ waitUntil: 'domcontentloaded' }),
  page.click('a.next-page'),
]);

Set a timeout per navigation or for the page

The per-call timeout is in milliseconds and defaults to 30,000 ms. A value of 0 disables that timeout, removing the time bound for the wait. Prefer a finite limit for automation that must recover from stalled pages.

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

To change the default maximum navigation time for a page, use page.setDefaultNavigationTimeout(timeout). Puppeteer documents it for goto() and related methods including goBack(), goForward(), reload(), setContent(), and waitForNavigation(). A per-call timeout lets one navigation use a different bound. The page’s general default timeout can also be changed with page.setDefaultTimeout(). setDefaultNavigationTimeout()

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check the response when HTTP success matters

Inspect the returned response before proceeding when your script needs to distinguish successful HTTP responses from error statuses. Also allow for null on about:blank or hash-only navigation.

const response = await page.goto('https://example.com', {
  waitUntil: 'domcontentloaded',
});

if (response === null) {
  console.log('Navigation completed without a main-resource response.');
} else {
  console.log('Final response status:', response.status());
}

The code checks and reports the final response status rather than assuming navigation completion means success. Apply your own status-handling policy to the task, such as stopping on an unexpected status.

Common problems and fixes

  • goto() times out on a page that keeps loading: choose a lifecycle condition appropriate to the next step instead of always waiting for 'load'; if the task needs a particular UI state, navigate and then wait for its selector. Keep a finite timeout so the script can handle a stalled navigation.
  • The response is null: this is documented for about:blank and same-URL hash-only navigation. Check for a response before calling response methods.
  • The promise resolves but the page returned an error status: inspect response.status(); a fulfilled navigation alone does not establish HTTP success. In headless shell, 404 and 500 are examples of valid statuses that do not make goto() throw.
  • The expected widget is missing after navigation: lifecycle completion does not guarantee application readiness. Wait for the relevant selector or state explicitly.
  • A click-triggered navigation is missed: pair page.waitForNavigation() and page.click() in Promise.all() so the wait is active before the click.
  • The target is a PDF in headless shell: headless shell does not support navigation to a PDF document. Use a workflow that does not depend on navigating to that PDF in headless shell.
  • The timeout never ends: check whether the call or page default was set to 0, which disables the timeout.
  • The referrer is not the value set in extra headers: a per-call referer takes precedence over the referer header configured with page.setExtraHTTPHeaders().

Or skip the browser setup

If you need a rendered website screenshot rather than browser automation, ScreenshotNeo offers a screenshot API and MCP server. Its one-call request can return an image or PDF:

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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

Sign up for 1,000 free screenshots a month, with no card required.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.