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

To capture a single-page app (SPA) after it renders, navigate with Puppeteer, wait for a condition that proves the specific view you need is ready, then call page.screenshot(). A network-idle setting can help, but it only describes network activity; it does not guarantee that the app has displayed its client-rendered content.

Capture an SPA after its target view appears

Use a selector or application-specific condition tied to the content you want in the image. The example below uses a visible results container. Replace the URL and selector with values from your app.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.setViewport({width: 1280, height: 800});
  await page.goto('https://example.com/app', {waitUntil: 'networkidle2'});
  await page.waitForSelector('[data-testid="results"]', {visible: true});
  await page.screenshot({path: 'app.png', fullPage: true});
} finally {
  await browser.close();
}

This is an illustrative combination of Puppeteer APIs, not a tested script for a particular application. The placeholder selector must exist in your page. If the results container appears before its data is loaded, wait for a stronger signal, such as a non-empty result list or the disappearance of a loading indicator.

Choose a readiness condition that matches the app

Navigation lifecycle events and network-idle conditions are useful signals, but neither necessarily means the app has finished its client-side work. A page can remain network-active because of polling, analytics, or long-lived connections. It can also become quiet before a delayed UI update appears.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • 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
Wait strategy What it observes When it helps
waitUntil: 'load' or 'domcontentloaded' A browser navigation lifecycle event. When the event is a useful starting point for your page, followed by an app-specific readiness check if needed.
waitUntil: 'networkidle0' No more than zero active network connections for at least 500 ms. When the page becomes network-quiet and this is a suitable prerequisite for the target state.
waitUntil: 'networkidle2' No more than two active network connections for at least 500 ms. When a small amount of ongoing network activity should not prevent navigation from reaching this lifecycle condition.
Selector or locator wait The presence or visibility of a relevant DOM element. When a specific element reliably marks the desired view.
page.waitForFunction() A page-context predicate becoming truthy. When readiness depends on a more precise condition, such as rendered content or a completed loading state.

Puppeteer describes waitForFunction() as waiting for the supplied function to return a truthy value when evaluated in the page context. See the official Page interactions guide for selector and locator approaches, and the Screenshots guide for navigation and capture examples.

Wait for actual content when the container alone is too early

If your app first mounts an empty container and then fills it with data, wait for the condition that distinguishes “mounted” from “ready.” For example, if the app renders result rows with a stable class, you could use a predicate like this, adapting the selectors to your own markup:

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
await page.waitForFunction(() => {
  const results = document.querySelector('[data-testid="results"]');
  return results && results.querySelectorAll('[data-testid="result-row"]').length > 0;
});

For a loading indicator, the corresponding condition could instead wait for it to disappear. Avoid arbitrary delays as the only readiness check: a fixed timeout may be longer than necessary on a fast run and still too short on a slow one.

Capture the viewport, full page, or one element

  • Viewport: page.screenshot() captures the current page view by default. Set the viewport first if the image dimensions matter.
  • Full document: pass {fullPage: true} when the screenshot should include content beyond the viewport.
  • One component: wait for the relevant element and capture its screenshot. Puppeteer scrolls an element into view if needed; an element screenshot can fail if the element becomes detached before capture.

The screenshot API also documents options including path, type, clip, omitBackground, and quality. Quality is relevant only to formats that support it, not PNG. Consult the current Puppeteer Screenshots guide and API reference for supported option details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
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.

Troubleshoot blank or incomplete screenshots

  • The screenshot is blank: confirm that navigation succeeded and that your readiness condition corresponds to visible content, not merely an empty root element.
  • Some client-rendered content is missing: wait for a specific result, state change, or loading-indicator removal before capture.
  • networkidle0 never completes: ongoing requests may keep the page active. Try a different navigation lifecycle condition, then wait for the target UI state directly.
  • networkidle2 completes too soon: it permits up to two active connections during its quiet period. Add a selector or function wait for the view you need.
  • A selector wait times out: check that the selector exists in the rendered DOM, is spelled correctly, and is visible if you requested visibility. If the app uses a different state marker, wait for that instead.
  • An element screenshot fails: the element may have been removed or replaced after it was located. Wait for the final element state immediately before capture.

Or skip the browser setup

ScreenshotNeo can return a screenshot or PDF from one GET request. It removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. It also offers an MCP server for AI agents and includes 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000.

For example, using cURL:

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

See the ScreenshotNeo documentation for setup and options, then sign up for 1,000 free screenshots a month with no card.

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

Frequently Asked Questions

Does Puppeteer wait for React, Vue, or Angular rendering automatically?

Navigation lifecycle events report browser navigation or network conditions; they do not certify that a framework-specific view is ready. Wait for a DOM element or application condition that represents the view you need.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • 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

Can I capture only one component instead of the page?

Yes. Wait for the target element and use its screenshot method. Puppeteer brings a hidden element into view if needed, but capture can fail if the element is detached.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

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.