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.

To get a headless browser screenshot, launch a browser without a visible window, open the page, wait until the content you need is ready, capture the viewport, full page, element, or a clipped region, and then close the browser. Playwright and Puppeteer provide straightforward Node.js APIs; Chrome’s headless mode with the DevTools Protocol offers lower-level control.

What a headless browser screenshot is

“Headless” means the browser runs without a visible user interface. The page is still rendered by a browser engine, so the screenshot reflects the rendered page rather than raw HTML. Chrome documents headless operation for unattended environments and lists screenshot capture among its capabilities: Chrome Headless.

The practical workflow is the same across automation libraries: launch, navigate, wait for the page state you need, capture, and close. Your screenshot settings then determine whether you receive the current viewport, the full scrollable page, a selected element, or a coordinate-defined area.

Choose the right capture mode

Need Use Important detail
What fits on screen Viewport screenshot Set the viewport before navigation for predictable layout.
A long article or report Full-page screenshot fullPage: true captures the full scrollable page.
A card, chart, invoice, or component Element screenshot Target a selector or element handle instead of capturing surrounding content.
A fixed rectangle Clip screenshot Set the region using x/y coordinates and width/height.
Image data to process or return from an endpoint In-memory screenshot Omit the file path where supported; the API returns image bytes.

Playwright documents viewport, element, and full-scrollable-page capture in its screenshot guide. Its Page API also documents clipping and CSS-pixel or device-pixel scaling. Puppeteer documents full-page, clipped, and element capture in its screenshot guide and ScreenshotOptions.

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

Take a screenshot with Playwright

Install Playwright in a Node.js project, then install its browser. For example, use npm install playwright followed by npx playwright install chromium. Save this as an ES module, such as screenshot.mjs, and run it with node screenshot.mjs.

import { chromium } from 'playwright';

const browser = await chromium.launch({ headless: true });
try {
  const page = await browser.newPage({
    viewport: { width: 1440, height: 900 },
    deviceScaleFactor: 1
  });

  await page.goto('https://example.com', { waitUntil: 'networkidle' });
  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

The example captures a full-page PNG. Remove fullPage: true to capture just the configured viewport. Change the path extension to .jpg or .webp and set type: 'jpeg' or type: 'webp' to request those formats explicitly. Playwright supports PNG, JPEG, and WebP; quality is relevant to JPEG and WebP, while PNG is lossless in the documented API.

Capture one element or a region

For a specific component, use a locator and save its screenshot:

await page.locator('.invoice').screenshot({ path: 'invoice.png' });

For a coordinate-defined area, use clip. The rectangle is expressed in page coordinates:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.screenshot({
  path: 'header.png',
  clip: { x: 0, y: 0, width: 1440, height: 180 }
});

Return bytes instead of writing a file

Omit path and retain the returned buffer. You can then send it in an HTTP response, upload it to storage, or process it without an intermediate file:

const imageBytes = await page.screenshot({ fullPage: true });
// Use imageBytes as a Node.js Buffer.

For device-pixel or CSS-pixel output, Playwright’s screenshot API supports scale: 'device' and scale: 'css'. Device scale can produce a larger image; CSS scale produces output at CSS-pixel dimensions. See the Page API for the documented options.

Take a screenshot with Puppeteer

Install Puppeteer with npm install puppeteer. Save this example as screenshot.mjs and run node screenshot.mjs:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({ headless: true });
try {
  const page = await browser.newPage();
  await page.setViewport({ width: 1440, height: 900 });
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

Puppeteer’s official guide uses the same launch, navigate, capture, and close sequence. Its example waits for networkidle2; Playwright’s example uses networkidle. These are library-specific navigation conditions, not a guarantee that every application has finished rendering all meaningful content.

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

Element, clip, format, and in-memory options

For an element, locate it and call its screenshot method. For a rectangle, pass a clip. Puppeteer’s screenshot options include path, type, quality, fullPage, omitBackground, and captureBeyondViewport; check the ScreenshotOptions reference for behavior and defaults.

const element = await page.$('.invoice');
if (!element) throw new Error('Invoice element was not found');
const imageBytes = await element.screenshot({ type: 'png' });

When you omit path, Puppeteer returns binary image bytes by default. Set encoding: 'base64' if your workflow specifically needs a base64 string. For JPEG or WebP, the documented quality option controls image quality; PNG is lossless.

Use Chrome headless and the DevTools Protocol

Use Chrome directly when you need lower-level browser control or already operate a Chrome DevTools Protocol (CDP) client. Chrome’s headless mode runs without a visible UI and supports screenshots, PDFs, remote debugging, and virtual screen configuration. The CDP Page.captureScreenshot reference documents PNG, JPEG, and WebP formats, with screenshot data returned as base64 in the response.

Unlike Playwright’s or Puppeteer’s page-level screenshot calls, CDP requires a client to launch or connect to Chrome, issue protocol commands, and decode the returned data when binary image bytes are needed. This gives you direct protocol access but leaves more lifecycle and error-handling work to your application. For most scripts, the higher-level libraries are simpler.

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

Wait for the page state you actually need

A navigation event is not always the same as visual readiness. A site can render its shell first and fill in content later, or load images and fonts asynchronously. Use a navigation wait condition appropriate to the site, then add an application-specific check where necessary.

  1. Set the viewport before navigation. Layout, responsive breakpoints, and content wrapping can change with viewport dimensions.
  2. Choose a navigation condition. The examples use Playwright’s networkidle and Puppeteer’s networkidle2. A busy site may continue making requests, so these may not represent the state you want.
  3. Wait for a meaningful selector or app state. For example, wait for a report container to appear or for your application to expose a ready state. The selector and state are specific to your page.
  4. Decide how to handle fonts, images, and lazy content. If they matter to the screenshot, ensure they have loaded or been triggered before capture. Full-page capture does not, by itself, establish that every lazy-loaded asset has rendered as intended.
  5. Close the browser in a cleanup path. Use try/finally so navigation or screenshot errors do not leave browser processes running in a CI job.

Formats, quality, and output size

PNG is a sensible choice for text-heavy interfaces, diagrams, and pixel-accurate UI because it is lossless. JPEG or WebP can be preferable when a smaller, lossy image is acceptable. Playwright and Puppeteer document PNG, JPEG, and WebP output; their quality controls apply to JPEG and WebP, not lossless PNG. The precise quality range and defaults are library options, so consult the relevant API reference rather than assuming identical behavior.

Full-page captures can be much taller than a viewport screenshot, which increases the amount of image data to handle. Use an element or clip capture when the reader only needs a bounded component. Choose device-pixel output when the extra resolution is required; use CSS-pixel scaling when dimensions should track the layout’s CSS pixels.

Or skip the browser setup

For a one-request screenshot rather than maintaining browser automation, ScreenshotNeo accepts a URL and returns PNG, JPEG, WebP, or PDF. See the ScreenshotNeo website and API documentation for setup and options.

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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo can accept cookie or consent banners as a visitor and remove more than 60 known consent platforms, along with newsletter popups and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 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

Troubleshooting headless screenshots

  • The screenshot is blank or missing page content: Navigation may have completed before client-rendered content appeared. Wait for the relevant selector or application-ready state before capture.
  • Fonts or images are absent: The assets may still be loading, blocked, or lazy-loaded below the initial viewport. Wait for the required resources or trigger the content before taking the screenshot.
  • The page layout differs between runs: Set a consistent viewport before navigation and wait for a stable page state. Different viewport dimensions can trigger different responsive layouts.
  • An element screenshot fails: The selector may not match an element yet, or the element may not be present. Wait for it, verify the selector, and handle the missing-element case rather than assuming it exists.
  • The clipped image has the wrong area: Check the clip’s x/y origin, width, and height against the page coordinates. Use an element screenshot instead if the target is naturally identified by a selector.
  • The image file is missing: Confirm that path is set when you expect a file. If you omit it, Puppeteer returns bytes for you to consume; it does not save a file automatically.
  • The script hangs or the browser remains open: A navigation wait may be unsuitable for a page with ongoing network activity. Use a page-specific readiness condition and close the browser in a finally block.

Performance, reliability, and cost considerations

There is no reliable cross-tool speed benchmark established for these workflows here, so choose based on required browser control, capture options, and operational fit rather than an assumed speed ranking. Running a browser locally means your environment must provide the browser and its dependencies; CI or container packaging can require additional setup. The cited screenshot documentation describes capabilities, not a universal packaging recipe for every operating system or container.

For recurring captures, keep browser lifecycle management explicit, bound your navigation and readiness waits appropriately, and avoid capturing more pixels than needed. Full-page images use more output data than a viewport or element crop. If you need a hosted one-call workflow instead of packaging a browser, ScreenshotNeo’s API is an alternative; its published plans range from a free monthly allowance to paid tiers, with yearly billing offering two months free. Plan details are available on ScreenshotNeo.

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.

Which method should you use?

  • Use Playwright when you want a high-level API with documented viewport, full-page, element, clip, and scale options.
  • Use Puppeteer when its JavaScript API and Chrome DevTools Protocol-oriented workflow suit your project; it also documents Firefox support through its automation APIs.
  • Use Chrome with CDP when direct protocol control is important and you are prepared to handle connection, commands, and returned screenshot data yourself.
  • Use a screenshot API when you prefer not to install and operate a browser in your own environment.

Frequently Asked Questions

Can I take a headless browser screenshot without saving a file?

Yes. Puppeteer returns screenshot bytes when you omit the path. Playwright’s screenshot call also returns image data that you can keep in memory.

Does full-page capture include content loaded only after scrolling?

Not necessarily. Full-page capture covers the page’s scrollable dimensions, but lazy-loaded content may need to be triggered and checked before capture.

Which image format should I use for a screenshot?

PNG preserves image data losslessly and suits text or diagrams. JPEG and WebP support quality settings and can be suitable when smaller lossy output is acceptable.

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.

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