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

Use Puppeteer’s page.screenshot() to save a rendered page, or find an element and call element.screenshot() to capture only that element. The examples below use the current Puppeteer API documented for the 25.x series.

What you need before taking a screenshot

  • Node.js installed on your development machine.
  • A project with Puppeteer installed: npm install puppeteer.
  • A URL that your local browser can load.

Puppeteer downloads a compatible browser when installed. If your project uses a separately managed browser, configure its executable path according to your Puppeteer setup.

How do I take a screenshot with Puppeteer?

The basic sequence is: launch a browser, create a page, navigate to the URL, call page.screenshot(), then close the browser. Puppeteer’s official guide demonstrates this flow at pptr.dev/guides/screenshots.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({ path: 'screenshot.png' });
} finally {
  await browser.close();
}

path saves the image to disk. A relative path is resolved from the process’s current working directory. Without path, Puppeteer returns the image data instead of writing a file. The default return value is a Uint8Array; set encoding: 'base64' when you need a Base64 string. See the Page.screenshot() reference.

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

How do I take a full page screenshot in Puppeteer?

Set fullPage: true. The documented default is false, which captures the current viewport.

await page.screenshot({
  path: 'full-page.png',
  fullPage: true
});

For pages that render content as you scroll, full-page capture requests the complete document, but it does not guarantee that every application has finished its own asynchronous rendering. Wait for a meaningful selector or application state when necessary.

Wait for navigation and page content

The screenshots guide shows waitUntil: 'networkidle2' as one navigation option:

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.goto('https://example.com', { waitUntil: 'networkidle2' });

This means Puppeteer waits for a period with no more than two active network connections. It is a documented choice, not a universal signal that all images, animations, or client-side data are finished. For dynamic pages, combine navigation with a selector-specific wait such as await page.waitForSelector('.hero').

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

How do I screenshot an element with Puppeteer?

Locate the target with page.waitForSelector() or another locator, then call ElementHandle.screenshot(). Puppeteer scrolls the element into view if needed. If the element is detached from the DOM before capture, the operation throws an error. The API behavior is documented at ElementHandle.screenshot().

const card = await page.waitForSelector('[data-testid="pricing-card"]');
if (!card) {
  throw new Error('Pricing card was not found');
}
await card.screenshot({ path: 'pricing-card.png' });

Use a selector that identifies the intended component on your site; a generic selector such as div can match the wrong element or many elements.

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.

Handling elements that rerender

Single-page applications can replace a node after you locate it. Wait for the final state, locate the element again immediately before the screenshot, and capture that fresh handle. If the application intentionally removes the element, treat the detached-element error as a failed capture rather than saving an incomplete image.

Screenshot options that control the output

Need Option or method Behavior
Save a file path Writes the image to the specified path. The extension can determine the image type.
Capture the document fullPage: true Requests the full page instead of only the viewport; default is false.
Capture a rectangle clip Captures a specified region using a bounding box. The clip’s optional scale defaults to 1.
Choose format type Supported image type selection; documented default is 'png'.
Reduce JPEG/WebP size quality Integer/number from 0 to 100. It does not apply to PNG.
Transparent background omitBackground: true Hides the default white background and permits transparency; default is false.
Return Base64 encoding: 'base64' Returns a Base64 string instead of the default binary Uint8Array.
Capture outside the viewport captureBeyondViewport Documented default is false without a clip and true when a clip is supplied.

Option details and defaults are in Puppeteer’s ScreenshotOptions interface. Clip geometry is described in the ScreenshotClip interface.

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

Capture a clipped region

await page.screenshot({
  path: 'header-region.png',
  clip: { x: 0, y: 0, width: 1200, height: 240, scale: 1 }
});

A clip is useful when you know the page coordinates. For a semantic component, an element screenshot is usually less fragile because Puppeteer calculates the element’s bounding box.

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

Save JPEG or WebP

await page.screenshot({
  path: 'page.webp',
  type: 'webp',
  quality: 80,
  fullPage: true
});

Quality is meaningful for formats other than PNG. When a path is supplied, choose an extension and, when needed, set type explicitly.

Return bytes for further processing

const bytes = await page.screenshot();
// bytes is a Uint8Array by default

const base64 = await page.screenshot({ encoding: 'base64' });

Reliable capture checklist

  • Set a deterministic viewport before capture when pixel dimensions matter: await page.setViewport({ width: 1440, height: 900 });.
  • Wait for the selector or state that proves the content you need is rendered.
  • Use fullPage for the whole document, an element handle for a component, and clip for fixed coordinates.
  • Choose PNG for lossless output; use JPEG or WebP with an appropriate quality value when file size matters.
  • Always close the browser in a finally block so failures do not leave browser processes running.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failures and fixes

The screenshot is blank or missing late content

Navigation completion and application rendering are different events. Add a wait for the specific selector or state that indicates the content is ready. A networkidle2 wait can help, but it is not a guarantee for pages with ongoing connections or delayed client-side work.

The selector cannot be found

Confirm the selector matches the loaded document, wait with page.waitForSelector(), and check whether the content is inside an iframe. Content in a cross-origin iframe requires work with that frame’s own page context and permissions.

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.
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.

ElementHandle is detached

The page replaced the node after you located it. Wait for the final UI state, locate the element again, and call screenshot() on the new handle.

The output was not written to disk

Check that you passed path and that the process has permission to write to its directory. If you intentionally omitted path, consume or write the returned Uint8Array yourself.

Concurrent browser work behaves unexpectedly

Some page-creation and closing methods in the same browser context automatically wait while a screenshot is in progress. page.bringToFront() does not wait for an existing screenshot operation. Avoid overlapping operations on the same page unless your workflow accounts for that behavior; see the Page API reference.

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server when you want a rendered image without maintaining Puppeteer and a browser. One GET request returns PNG, JPEG, WebP, or a PDF.

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

See the ScreenshotNeo documentation for request options. Before capture, it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account.

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.