Use await page.waitForNetworkIdle() to wait for Puppeteer’s direct network-idle condition, or pass waitUntil: 'networkidle2' to page.goto() when the condition should be part of navigation. The direct method lets you set how many concurrent connections may remain and how long traffic must stay quiet; neither approach proves that a particular page element or application task is ready.
Choose the wait that matches the task
Puppeteer 25.12.0 documents two related ways to wait for network activity to settle. Use a navigation lifecycle condition when you want page.goto() to wait as part of loading a URL. Use page.waitForNetworkIdle() when you want a separate wait, or need to tune its connection threshold or quiet interval.
As an Amazon Associate I earn from qualifying purchases.
| Option | What it waits for | Use it when |
|---|---|---|
networkidle0 |
No more than zero connections for at least 500 ms. | Navigation should meet the zero-connection lifecycle threshold. |
networkidle2 |
No more than two connections for at least 500 ms. | Navigation may proceed with up to two connections remaining. Puppeteer’s screenshot guide uses this condition. |
page.waitForNetworkIdle(options) |
A direct wait with configurable concurrency and idleTime; the documented defaults are 0 and 500 ms. |
You need to wait separately from navigation or configure the quiet-period criteria. |
| Locator or application-specific condition | A particular element or action state, rather than general network activity. | The task depends on a specific UI state being present, visible, or actionable. |
The lifecycle conditions and direct method have separate API definitions; do not assume they are interchangeable in every detail.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWait for network idle during navigation
Pass networkidle2 as the navigation lifecycle condition when opening the page:
#1 Best Overall
await page.goto('https://example.com', {
waitUntil: 'networkidle2',
});
Use networkidle0 instead if navigation should wait until the lifecycle definition allows zero active connections for at least 500 ms. These thresholds describe the network-idle condition, not whether the page’s content is correct or every script has completed its application-specific work.
Wait separately with page.waitForNetworkIdle()
After navigation or another action, call the direct method. With no options, Puppeteer documents a concurrency default of 0 and an idleTime default of 500 milliseconds:
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
await page.waitForNetworkIdle();
The method returns a Promise<void> and waits at least the configured idle interval.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Set the quiet interval and connection threshold
For example, this waits for a one-second quiet interval while allowing up to two concurrent connections under the direct method’s threshold:
Rank #3
await page.waitForNetworkIdle({
concurrency: 2,
idleTime: 1_000,
timeout: 30_000,
});
The values 2 and 1_000 are example choices, not a general recommendation. Set them to fit the page and the condition your workflow needs. The shared wait options have a documented 30,000 ms default timeout; set a different timeout, use page timeout settings, or pass 0 to disable the timeout. A wait can also be canceled with an AbortSignal.
When network idle is the wrong condition
Network quiet is useful when the workflow actually depends on network activity settling. It is not a guarantee that an application-specific task has finished: a page can become quiet before the state you need appears, or ongoing background traffic can prevent the quiet threshold from being reached.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
If the next step requires a particular control to be available, wait for that element or use a locator action that waits for its relevant preconditions. Puppeteer’s interaction guidance describes locators as automatically waiting for elements and relevant action preconditions. This expresses a UI-readiness requirement more directly than waiting for general network inactivity.
Free tools Windows power users keep installed
One-click scans. No signup required.
Troubleshoot waits that do not resolve
The wait times out
The direct method’s shared wait options use a 30-second timeout by default. A page with continuing requests may never meet the selected idle threshold before that deadline. Choose a timeout appropriate to the workflow, and reconsider whether network quiet is the state you actually need. Disabling the timeout with timeout: 0 removes the deadline; it does not make a page become idle.
Best Value
The page is quiet, but the expected content is missing
Network-idle completion only describes the network condition. If you need a specific result, wait for the relevant element or application state rather than treating an idle network as proof that the result is ready.
Navigation waits differently from a later direct wait
waitUntil: 'networkidle2' is a lifecycle condition attached to navigation; page.waitForNetworkIdle() is a separate API with configurable options. Choose based on when the wait belongs in the flow, and configure the direct wait explicitly if you need its threshold or quiet interval to differ from its defaults.
Or skip the browser setup
If your goal is a website screenshot rather than browser automation, ScreenshotNeo can return an image or PDF from one GET request. Its capture flow accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify page verdict and billing status in headers. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents.
cURL example, using ScreenshotNeo’s API documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo offers 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000 screenshots. Learn about ScreenshotNeo or sign up for the free plan.
Quick Recap
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.




