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

waitUntil tells Puppeteer which navigation milestone must be reached before page.goto() or page.waitForNavigation() resolves. Use domcontentloaded when your next operation only needs the parsed DOM, load when it needs the browser’s load event, and a network-idle value only when a connection-count threshold is a useful signal for that site. None of the four values proves that an application has finished rendering or that a particular element contains the data you need.

The current Puppeteer API reference (version 25.12.0 displayed on September 29, 2026) defines networkidle0 and networkidle2 as quiet periods of at least 500 ms. The practical choice is therefore driven by what your script does next, not by a universal idea of when a page is “ready.”

What waitUntil actually waits for

The option selects a navigation lifecycle condition. It does not select a framework-specific “loaded” state, run your application’s data-fetching logic, or wait for every possible background task.

Value Documented condition Use it when
load Waits for the browser load event. The next step depends on the load lifecycle event or resources that participate in it.
domcontentloaded Waits for the browser DOMContentLoaded event. The next step can begin once the document has been parsed and the DOM milestone has fired.
networkidle0 Waits until there are no more than zero network connections for at least 500 ms. The page is expected to become completely quiet and does not maintain background requests.
networkidle2 Waits until there are no more than two network connections for at least 500 ms. You need a quiet interval but the page may keep up to two connections open.

These definitions come from Puppeteer’s PuppeteerLifeCycleEvent reference. The 500 ms interval and connection counts are API conditions, not performance measurements.

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.

Choosing the right value

Choose by the operation after navigation

  • Choose domcontentloaded if you immediately inspect DOM nodes, inject a script, or perform an action that does not require all load-event resources.
  • Choose load if the next operation assumes the browser’s load event has fired.
  • Choose networkidle0 only for pages that can genuinely reach zero active connections. Analytics, polling, streaming, advertisements, and other long-lived activity can prevent that condition.
  • Choose networkidle2 when up to two ongoing connections are acceptable during the quiet interval.

Wait for application state separately

If your real requirement is “the report table exists,” “the chart has data,” or “the login result is visible,” wait for that condition explicitly after navigation. For example:

await page.goto('https://example.com/report', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('[data-report-ready]');

A lifecycle event and a selector check answer different questions: the first describes browser navigation; the second checks an application-specific condition.

load versus domcontentloaded

DOMContentLoaded marks the point at which the document has been parsed. The load event is a later browser milestone. If your script only needs the DOM, waiting for load can delay work unnecessarily. If it depends on resources or behavior associated with the load event, use load instead. Neither event says that a single-page application has completed its asynchronous API calls.

networkidle0 versus networkidle2

The threshold is the difference

Both values require the threshold to remain satisfied for at least 500 ms. networkidle0 allows no connections; networkidle2 allows no more than two. Consequently, networkidle0 is stricter and is more likely to wait indefinitely on a page with recurring requests. networkidle2 can resolve while one or two connections remain, so it is not proof that every request has finished.

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.

Why network idle is not universal readiness

A page can start work after the quiet interval, keep a connection open for a service worker or stream, or render data only after an application state transition. Use a selector, an evaluated state check, or another page-specific signal for that final requirement. Treat network idle as a navigation timing condition, not as a guarantee that every component is complete.

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.

Using waitUntil with page.goto()

page.goto(url, options) accepts navigation options and resolves to the main-resource response. This complete example uses the DOM milestone and then waits for the element the script actually needs:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  const response = await page.goto('https://example.com/dashboard', {
    waitUntil: 'domcontentloaded'
  });

  await page.waitForSelector('#dashboard');
  console.log('status:', response ? response.status() : 'no response object');
  console.log('title:', await page.title());
} finally {
  await browser.close();
}

Replace domcontentloaded with load, networkidle0, or networkidle2 when that documented condition matches your next step.

Check HTTP status separately

The returned response is useful when status matters. In headless shell, a valid HTTP error such as 404 or 500 does not by itself make goto() throw; inspect HTTPResponse.status() and decide whether your workflow should stop.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const response = await page.goto(url, { waitUntil: 'load' });
if (response && response.status() >= 400) {
  throw new Error(`Navigation returned HTTP ${response.status()}`);
}

Understand redirects and null responses

For multiple redirects, the response corresponds to the last redirect. Navigation to about:blank or to the same URL with only a different hash returns null, so always guard the response before reading its status.

Waiting for a click-triggered navigation

When a click starts navigation indirectly, begin waiting and click in the same Promise.all. This prevents a race in which the click navigates before the wait has been installed:

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.
const [response] = await Promise.all([
  page.waitForNavigation({ waitUntil: 'domcontentloaded' }),
  page.click('a.my-link')
]);

if (response) {
  console.log('arrived with status', response.status());
}

waitForNavigation() is intended for this pattern. A navigation caused by the History API, or one that changes only to a different anchor, resolves with null; History API URL changes still count as navigation in Puppeteer’s API documentation.

Combining lifecycle and readiness checks

A reliable sequence separates browser navigation from application readiness:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Start navigation with the least restrictive lifecycle condition that supports the next operation.
  2. Check the returned response when an HTTP status affects the workflow.
  3. Wait for a selector or evaluate a page-specific state that proves the required content exists.
  4. Only then capture text, click controls, create a PDF, or take a screenshot.
await page.goto('https://example.com/products', {
  waitUntil: 'networkidle2'
});

await page.waitForSelector('[data-products-loaded]');
const products = await page.$$eval('.product-card', cards =>
  cards.map(card => card.textContent.trim())
);

If the site maintains more than two connections, replace the network-idle condition with an event milestone and an explicit readiness check rather than making the idle threshold carry both jobs.

Troubleshooting common failures

Navigation times out while using a network-idle value

Cause: the page continually polls, opens a stream, loads advertising, or otherwise never remains below the selected connection ceiling for 500 ms.

Fix: use domcontentloaded or load, then wait for the specific selector or state your task needs. Do not switch to networkidle0 merely because it sounds more complete.

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 script continues before the data appears

Cause: a lifecycle event fired before the application’s asynchronous rendering completed.

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

Fix: add page.waitForSelector() for a stable, page-specific marker or evaluate the state your application exposes.

The click navigation is missed

Cause: the script called page.click() before starting waitForNavigation().

Fix: use the documented Promise.all arrangement so both promises are created together.

response is null

Cause: the navigation was to about:blank, a hash-only URL, or a History API transition that has no new main-resource response.

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.

Fix: test for a response before reading status(), and use DOM or application-state checks when no HTTP response is expected.

A 404 or 500 did not throw

Cause: a valid HTTP error status is still a completed HTTP response; in headless shell it does not automatically reject goto().

Fix: inspect response.status() and apply your own status policy.

The selector check is flaky

Cause: the selector appears before its contents are usable, or it is replaced during rendering.

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

Fix: choose a marker that represents the completed state, then read its contents only after that marker is present. If the page exposes no stable marker, coordinate with the application rather than relying on a broader network threshold.

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

Performance and reliability considerations

  • domcontentloaded generally permits the earliest script continuation, while load waits for a later browser event.
  • Network-idle conditions can add at least a 500 ms quiet-period requirement and can wait much longer when requests recur.
  • Using a stricter condition does not make a page more correct if the condition is unrelated to the state you need; it can only increase waiting or create a timeout.
  • For repeatable automation, keep the lifecycle choice and the application readiness check separate so a site’s analytics or polling behavior does not silently change your result.
  • Log the selected condition, the final URL, whether a response was returned, and the HTTP status when available. That makes redirects, null responses, and server errors distinguishable.

The API pages linked above were checked on September 29, 2026 and displayed Puppeteer 25.12.0. Recheck the official references when targeting a later release because API descriptions can change.

Or skip the browser setup

If your goal is a clean website image rather than browser automation itself, ScreenshotNeo provides a GET endpoint that returns PNG, JPEG, WebP, or PDF. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

One-call cURL example (see the ScreenshotNeo API documentation):

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

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}`);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Every feature is included on every plan: the Free plan provides 1,000 shots per month with no card, and paid plans start at $5 for 3,000 shots. Sign up free for 1,000 screenshots a month with no card.

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.