October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Take Screenshots with Headless Chrome

Use Chrome’s headless command line for a quick screenshot, or Puppeteer for scripted, full-page, and element captures. Learn sizing, timing, output options, and fixes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a quick screenshot, run chrome --headless --screenshot --window-size=412,892 https://example.com/. Chrome saves screenshot.png in the current working directory by default. For repeatable captures, full-page images, or a selected element, use Puppeteer’s Page.screenshot().

Take a screenshot from the command line

Chrome’s Headless command-line reference documents --screenshot for saving a page image and --window-size=WIDTH,HEIGHT for choosing the capture dimensions. Replace the example URL and size as needed:

As an Amazon Associate I earn from qualifying purchases.

chrome --headless --screenshot --window-size=412,892 https://example.com/

The output is screenshot.png in the directory from which you ran Chrome. The dimensions specify the browser window used for the capture; the page’s responsive layout will depend on them. Keep the same dimensions across runs when comparing screenshots. See the Chrome Headless command-line reference for supported flags and current details.

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.

Capture a PDF instead

If you need a document rather than an image, use Chrome’s PDF option:

#1 Best Overall
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
chrome --headless --print-to-pdf https://example.com/

This creates a PDF, not a PNG screenshot. The CLI also supports --no-pdf-header-footer to omit print headers and footers.

Automate screenshots with Puppeteer

For recurring captures or more control over what is saved, navigate to the page in Puppeteer and call page.screenshot(). This runnable Node.js example writes a viewport screenshot to page.png:

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
import puppeteer from 'puppeteer';

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

The Puppeteer screenshots guide demonstrates waiting for navigation with waitUntil: 'networkidle2' before capturing. Choose a wait condition suited to the page rather than assuming one condition works everywhere. Consult the Puppeteer Screenshots guide for its workflow.

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

Choose the capture area and output

Puppeteer’s screenshot options cover viewport captures, full-page images, selected elements, and clipped regions. The documented defaults and key choices are:

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.
Need Option or method What to know
Save to a file path A relative path is resolved from the current working directory.
Capture the full page fullPage: true The default is false.
Capture a rectangle clip Defines a clipped region rather than relying on the default viewport capture.
Capture an element Element screenshot Use an element’s screenshot method when the target is a particular page element.
Choose image format type PNG is the documented default.
Set lossy-image quality quality Applies to formats other than PNG.
Keep the background transparent omitBackground Controls whether the default background is omitted.
Capture outside the viewport captureBeyondViewport Available as a screenshot option; select it where the capture requires it.

These options are documented in Puppeteer’s ScreenshotOptions API. For full-page capture, a typical call is await page.screenshot({ path: 'full-page.png', fullPage: true });.

Wait for the page at the right time

A screenshot is only as complete as the page state at capture time. Puppeteer’s guide uses networkidle2 during navigation, but network inactivity is not a universal signal that every page is visually ready. Persistent network connections may prevent an idle condition, while a fixed delay may be too short for one page and unnecessarily long for another.

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

Chrome’s CLI offers --timeout, in milliseconds, to bound how long it waits before --dump-dom, --screenshot, or --print-to-pdf captures content. Reaching the timeout does not guarantee that asynchronous content has finished rendering. The CLI also provides --virtual-time-budget to advance time-dependent code as if a chosen amount of time had passed. The documented example uses a 42,000 ms budget; that is an example, not a recommended setting for every site.

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

Common problems and fixes

  • The output file is not where expected: Chrome writes screenshot.png to the current working directory by default. Run the command from the directory where you want the file, or use Puppeteer’s path option to choose a filename.
  • The screenshot has the wrong dimensions or layout: Set --window-size=WIDTH,HEIGHT in the CLI or call page.setViewport() before navigating and capturing. Responsive pages can render differently at different sizes.
  • Part of the page is missing: A default Puppeteer screenshot is not full-page. Set fullPage: true for a full-page image, or use an element screenshot or clip when only a specific region is needed.
  • Content has not appeared yet: Revisit the navigation wait condition or capture timing. A CLI timeout is only a maximum wait; it does not establish that all asynchronous content is ready.
  • The command produces a PDF rather than an image: --print-to-pdf is the PDF workflow. Use --screenshot for an image.
  • PNG ignores the requested quality: Puppeteer documents quality for image formats other than PNG. Choose another supported type if you need that quality setting.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its one-call API can return an image or PDF without requiring you to manage a browser locally. See the ScreenshotNeo documentation for API options.

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

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.

Frequently Asked Questions

Does Chrome’s command-line screenshot include the full page?

The basic CLI example captures using a chosen window size. For full-page capture, use Puppeteer’s fullPage: true option.

Can Puppeteer save a screenshot as JPEG or WebP?

Puppeteer’s screenshot options include a type setting; PNG is the documented default, and the quality option applies to formats other than PNG.

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 *

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.

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
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.