Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

How to Take a Puppeteer Screenshot After page.evaluate()

Run page-side JavaScript with page.evaluate(), then capture the rendered page separately with Puppeteer’s page.screenshot().
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

page.evaluate() runs JavaScript in the page and returns that function’s result; it does not capture an image. After the page-side work is complete, call page.screenshot() in your Node.js script. For one element rather than the full page, use ElementHandle.screenshot().

What page.evaluate() does—and what it does not do

Puppeteer’s Page.evaluate(pageFunction, ...args) evaluates a function in the browser page’s JavaScript context and returns its result. Puppeteer awaits a Promise returned by that function. The result might be a title, text, or another value produced by your code; it is not a screenshot file. The API reference describes it as evaluating a function in the page’s context and returning the result: Puppeteer Page.evaluate().

As an Amazon Associate I earn from qualifying purchases.

Screenshot capture is a separate Puppeteer operation on the Page object: page.screenshot(). The official guide identifies that method for capturing screenshots: Puppeteer Screenshots guide.

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

Capture a page after running page-side JavaScript

Run page.evaluate() when you need to inspect or change page content, then take the screenshot in a subsequent call. This Node.js example assumes Puppeteer is installed and that the target page can be reached:

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com');

    const title = await page.evaluate(() => {
      // This function runs in the browser page context.
      return document.title;
    });
    console.log('Page title:', title);

    // This separate Puppeteer call captures the rendered page.
    await page.screenshot({ path: 'screenshot.png' });
  } finally {
    await browser.close();
  }
})();

The example saves the screenshot to screenshot.png, following the official guide’s path pattern. You can omit page.evaluate() entirely if you have no page-side work to do before capturing.

Capture one element instead of the whole page

Wait for the target selector, then call screenshot() on the returned element handle:

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
const element = await page.waitForSelector('.report-card');
if (!element) {
  throw new Error('Could not find .report-card');
}
await element.screenshot({ path: 'report-card.png' });

ElementHandle.screenshot() targets that element; the guide notes that Puppeteer attempts to scroll an element into view if it is hidden. See the official screenshots guide for the element capture method.

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

Choose the output form you need

With path, Puppeteer writes the screenshot to a file. Without that file-saving option, the documented default result is a Uint8Array; the API also documents a base64 string result when you set encoding: 'base64'. Those forms are useful when the next step is to process or transmit the image instead of saving it directly. Check the API reference for the Puppeteer version you use: Page.screenshot().

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.
// Get screenshot bytes for downstream processing.
const bytes = await page.screenshot();

// Or request base64 data.
const base64 = await page.screenshot({ encoding: 'base64' });

Wait for the content your screenshot needs

Place application-specific waits between navigation or page changes and the screenshot call. For example, wait for a particular selector if your application renders the target asynchronously:

await page.waitForSelector('.report-ready');
await page.screenshot({ path: 'report.png' });

A selector wait is only an example of coordinating with your page. The reviewed Puppeteer references do not establish a universal wait condition that guarantees every font, image, animation, or lazy-loaded item is ready. Identify the condition that means the specific content you need is ready, then wait for that condition before capturing.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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

Screenshot operation coordination

The Puppeteer API reference documents a concurrency detail: while a screenshot is in progress in a BrowserContext, BrowserContext.newPage(), Browser.newPage(), and Page.close() wait for the screenshot to finish; Page.bringToFront() does not wait for existing screenshot operations. If your script coordinates captures with page creation, closure, or tab focus, account for that behavior and consult the reference for your installed version: Page.screenshot() API reference.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Troubleshooting common problems

  • You got a value but no image. That is the return value of your page.evaluate() function. Call page.screenshot() separately on the Page.
  • The screenshot is missing the change made in evaluate. Make sure the evaluate call is awaited, and take the screenshot after it completes. If the page updates asynchronously after the function returns, wait for an application-specific ready condition too.
  • The element capture fails or targets nothing. Confirm the selector matches an element and wait for it before calling element.screenshot(). The method operates on an element handle, not a selector string.
  • The image is incomplete. A screenshot call alone does not establish that all page assets or lazy content have finished. Wait for the specific image, component, or state your use case requires.
  • You expected a file but received data. Use { path: 'screenshot.png' } to save via the guide’s file pattern, or handle the returned bytes/base64 according to the encoding option you selected.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you only need a screenshot from a URL, ScreenshotNeo provides a one-request screenshot API and MCP server. For example, save a WebP screenshot using cURL:

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.
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. Cookie banners and consent prompts are accepted or removed before capture, along with known newsletter popups and chat widgets; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server exposes screenshot tools for AI agents, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up for 1,000 free screenshots a month—no card required.

Version note

The official Puppeteer references reviewed display version 25.12.0. Method roles and options can change between releases, so use the API documentation corresponding to the version installed in your project.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.