Use Puppeteer’s page.screenshot() to capture the current Chromium page. Set path to save the image, fullPage: true for the whole document, or clip for a rectangle. To capture one element, use ElementHandle.screenshot(). The examples below use Puppeteer’s general API; if your browser is running through WebDriver BiDi, check its smaller supported option set before relying on other screenshot settings.
How do I take a screenshot with Puppeteer?
Install Puppeteer in your project, then launch a browser, open a page, navigate to the URL, and pass a file path to page.screenshot(). This ES module example saves a PNG in the process working directory:
As an Amazon Associate I earn from qualifying purchases.
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();
}
The Puppeteer screenshots guide demonstrates this basic flow. The finally block closes Chromium even if navigation or capture throws an error.
Wait for the page you actually need
page.goto() waits for its selected navigation lifecycle event, but a completed navigation does not guarantee that every image, font, animation, or application-rendered component is visually ready. Choose a readiness condition that matches the site. Puppeteer’s guide demonstrates networkidle2, but it is not a universal guarantee that all visual assets are ready. For an application-specific landmark, wait for it explicitly:
#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
await page.goto('https://example.com');
await page.waitForSelector('main article');
await page.screenshot({ path: 'article.png' });
Use a selector that reliably represents the content you want; if a site renders it conditionally or replaces it during navigation, account for that in your own readiness logic.
How do I take a full-page screenshot?
Set fullPage: true to capture the full document rather than just the visible viewport:
await page.screenshot({ path: 'full-page.png', fullPage: true });
Without an area option, fullPage is false and Puppeteer captures the viewport. The screenshot options reference documents captureBeyondViewport as false by default when no clip is supplied and true when a clip is supplied; set it explicitly if capture beyond the viewport matters to your chosen rectangle. See ScreenshotOptions for the option details.
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 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #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
How do I screenshot a specific element?
Find the element, check that the selector matched, then call screenshot() on its handle:
const element = await page.waitForSelector('main article');
if (!element) throw new Error('Article not found');
await element.screenshot({ path: 'article.png' });
ElementHandle.screenshot() scrolls the element into view if needed. It throws if the handle has become detached from the DOM, so wait for the element at the right point in the page lifecycle and reacquire it if the application replaces it. See the ElementHandle screenshot API.
How do I capture a rectangle?
Pass a clip rectangle with the desired position and size. For example, this captures a 600-by-400-pixel region starting at coordinates x: 100, y: 150:
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.
await page.screenshot({
path: 'region.png',
clip: { x: 100, y: 150, width: 600, height: 400 }
});
Use coordinates and dimensions appropriate for the page and viewport you configured. The screenshot options reference documents clip and the related captureBeyondViewport setting.
How do I save the screenshot to a file or use the returned data?
With path, Puppeteer writes the image to that location; a relative path is resolved from the process working directory. Without path, the call returns image data as a Uint8Array by default. Set encoding: 'base64' if you need a base64 string instead. These behaviors are documented in Page.screenshot().
const bytes = await page.screenshot();
// bytes is a Uint8Array by default
const base64 = await page.screenshot({ encoding: 'base64' });
Choose one output route for a given capture: write directly to a file with path, or receive data and handle storage or transmission in your application.
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
Which screenshot output options should I choose?
| Need | Setting | What it does |
|---|---|---|
| PNG output | type: 'png' |
PNG is the documented default. When a path is provided, Puppeteer can infer the type from the file extension. |
| JPEG or another supported format | type and optionally quality |
quality ranges from 0 to 100 and applies only to formats that support it; it does not apply to PNG. |
| Transparent background | omitBackground: true |
Hides the default white background. The default is false. |
| Image data instead of file output | Omit path, optionally set encoding: 'base64' |
Returns a Uint8Array by default or a base64 string when requested. |
| Rectangular crop | clip |
Limits the capture to the specified rectangle. |
| Speed-related option | optimizeForSpeed |
Documented with a default of false; the cited reference does not establish a performance gain or when it is beneficial. |
Refer to the ScreenshotOptions API when choosing settings. Avoid treating a JPEG quality value as a universal best setting; the right value depends on your output requirements.
What changes when Puppeteer uses WebDriver BiDi?
Puppeteer’s WebDriver BiDi support page lists clip, encoding, and fullPage as supported screenshot parameters. That is a narrower set than the general screenshot options reference. If your setup uses WebDriver BiDi, verify support for options such as omitBackground, quality, and captureBeyondViewport rather than assuming they work. Consult the WebDriver BiDi support page for the documented subset.
Recommended Free Tools
Troubleshooting Puppeteer screenshots
- The image is blank or missing expected content: Navigation may have completed before the page rendered the content you need. Wait for an application-specific selector or other appropriate readiness condition before capturing.
- The element cannot be found: Check the selector and timing. Use
waitForSelector()before capture and handle the case where it returns no element. - An element capture fails after the page updates: The original handle may have become detached because the application replaced the node. Wait for the updated content and obtain a fresh handle.
- The output is only the visible screen: Set
fullPage: truefor the entire document; the default is a viewport screenshot. - The captured area is wrong: Recheck the
clipcoordinates and dimensions against the page and viewport. If a rectangle extends beyond the viewport, check the documentedcaptureBeyondViewportbehavior and protocol support. - Transparency or quality settings do not work: PNG does not use the
qualityoption; transparency requiresomitBackground: true. If using WebDriver BiDi, verify that the option is supported there. - The file appears in an unexpected directory: A relative
pathis resolved against the process working directory. Use an absolute path if you need a fixed location.
Version and performance considerations
The current Puppeteer API documentation consulted here displays version 25.12.0; this identifies the documentation version, not the version installed in your project. Check the documentation corresponding to your installed package before depending on version-specific behavior. The options reference describes optimizeForSpeed but does not establish a general speed improvement, so do not assume it will reduce capture time without measuring it in your own setup.
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.
Or skip the browser setup
ScreenshotNeo can return a screenshot from one GET request, without setting up Puppeteer or managing a browser instance. Its capture process accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents using Claude, Cursor, or another MCP client. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.
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 parameters. The service supports PNG, JPEG, WebP, or PDF output; sign up for 1,000 free screenshots a month with no card.
ScreenshotNeo is a website screenshot API and MCP server made by Yorker Media. Learn more at ScreenshotNeo.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteFrequently Asked Questions
What does Puppeteer use to take a screenshot?
Use page.screenshot() for a page capture and ElementHandle.screenshot() for one DOM element.
Does Puppeteer screenshot PNG by default?
Yes. The general screenshot options documentation lists PNG as the default image type.
Which screenshot options are listed for Puppeteer WebDriver BiDi?
The WebDriver BiDi support page lists clip, encoding, and fullPage.
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.
Free tools Windows power users keep installed
One-click scans. No signup required.




