For a direct URL, await page.goto() before calling page.screenshot(). For a click that navigates, start page.waitForNavigation() before the click and await both together with Promise.all(). If the screenshot depends on content rendered after navigation, wait for that specific content too.
Wait for a direct navigation
Pass a lifecycle condition to page.goto(), await it, then take the screenshot. Puppeteer’s screenshot guide demonstrates this sequence; networkidle2 is one option, not a guarantee that every application has finished rendering.
const url = 'https://example.com';
await page.goto(url, { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'screenshot.png' });
Puppeteer screenshot guide · Page.goto() API
Wait when a click causes navigation
Register the navigation wait before clicking. Starting the wait afterward can miss the navigation event and create a race condition. Await both promises together, then capture the screenshot.
const [response] = await Promise.all([
page.waitForNavigation({ waitUntil: 'networkidle2' }),
page.click('a.my-link'),
]);
await page.screenshot({ path: 'screenshot.png' });
response is optional for this screenshot flow. Keep it if you need to inspect the main-resource response. Navigation waits can resolve to null in documented cases such as about:blank or a same-URL hash change, so do not assume that a response object is always available. Puppeteer also treats History API URL changes as navigation.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- 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
Puppeteer Page API · Frame.waitForNavigation() API
Choose a navigation wait condition
The documented default is load. You can pass one lifecycle condition or an array; with an array, all listed events must occur before the wait resolves.
Rank #2
- 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
| Condition | What it waits for | When it may fit |
|---|---|---|
domcontentloaded |
The DOMContentLoaded event. | The needed DOM is available and later resources are not important to the screenshot. |
load |
The browser load event. | The page’s load event is an adequate navigation boundary; this is the documented default. |
networkidle0 |
No more than zero network connections for at least 500 ms. | The page can reach that idle condition and you need it before continuing. |
networkidle2 |
No more than two network connections for at least 500 ms. | The page may keep a small number of requests active while becoming sufficiently idle for your workflow. |
These network-idle conditions are browser lifecycle heuristics, not proof that an app has finished fetching screenshot-critical data, updating its interface, or playing animations. Persistent connections or background requests can also make network idle unsuitable. Choose based on the page and the content you need, rather than assuming one condition is universally faster or more reliable.
Puppeteer lifecycle event reference · WaitForOptions reference
Rank #3
- 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 screenshot-critical content
If navigation completes before the relevant component appears, add a page-specific readiness condition. For example, wait for a report element to be visible after the DOM loads:
const url = 'https://example.com/report';
await page.goto(url, { waitUntil: 'domcontentloaded' });
await page.waitForSelector('[data-testid="report-ready"]', { visible: true });
await page.screenshot({ path: 'report.png' });
Use a selector the target page actually exposes. Without visible: true, waitForSelector() waits for the selector to appear in the DOM; with it, Puppeteer waits for the element to be visible. The selector wait works across navigations. For actions, Puppeteer’s locators wait for an element to be present and in the appropriate state; documented action preconditions include viewport presence, visibility, enabled state, and a stable bounding box for actions such as clicking. Prefer a meaningful selector or locator condition over an arbitrary fixed sleep.
Rank #4
- 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
Page.waitForSelector() API · Page interactions guide
Set and handle timeouts
WaitForOptions documents a default timeout of 30,000 ms. You can set a timeout for an individual wait or change a page’s default timeout through its timeout-setting methods. A timeout of 0 disables the timeout; use that deliberately, since an unreachable condition could then leave the script waiting indefinitely.
Best Value
- 【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.
await page.goto(url, {
waitUntil: 'networkidle2',
timeout: 45_000,
});
Set the timeout to fit the target and your workflow, then handle errors so a failed wait does not silently produce a misleading screenshot. The documented defaults and available methods are described in the WaitForOptions reference.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Capture the screenshot after the waits
Page.screenshot() returns screenshot bytes by default; its options also support saving to a path, as in the examples above. Await it so the capture operation finishes before the script proceeds.
const image = await page.screenshot();
// image contains the screenshot bytes.
Troubleshooting navigation waits
- The click happens but the navigation wait times out: create the wait before the click and await both through
Promise.all(). If the action changes content without navigating, wait for the resulting selector or locator state instead. networkidle0ornetworkidle2never resolves: the page may have persistent connections or continuing background requests. Try an appropriate lifecycle event such asdomcontentloadedorload, followed by an explicit readiness selector.- The wait resolves but the screenshot is missing content: navigation completion was not the app’s readiness condition. Wait for the particular element or state the screenshot requires.
waitForSelector()times out: verify the selector against the current page and check whether the element is actually inserted and, when requested, visible. The documented default selector timeout is 30,000 ms and can be configured for the call or page.- The navigation response is
null: do not treat that alone as a failure. Special cases includeabout:blankand same-URL hash navigation. - The capture finishes later than expected: check which waits are active and whether their conditions fit the site. A broad network-idle wait can be inappropriate for a page that continually communicates in the background.
Or skip the browser setup
If you need a screenshot endpoint rather than a Puppeteer browser script, ScreenshotNeo returns an image or PDF from one GET request. Its clean-shot steps accept consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; you can turn each step off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
Example cURL request:
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 documentation for the API details. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
Free tools Windows power users keep installed
One-click scans. No signup required.
More Puppeteer guidance
The official Puppeteer documentation results identify v25.12.0 for several references used here, while the waitForNavigation() reference identifies v25.9.0. Check the live API reference for details that may vary by version. For broader testing and screenshot workflows, Packt lists UI Testing with Puppeteer as a paperback published in March 2021; it is optional background reading, not a requirement for this procedure.
Quick Recap
Packt: UI Testing with Puppeteer
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.

