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

Use Chrome Headless for a one-off image, Puppeteer for a maintainable JavaScript script, or the Chrome DevTools Protocol (CDP) when you already control Chrome at protocol level. The shortest command is chrome --headless=new --screenshot --window-size=412,892 https://developer.chrome.com/; it writes screenshot.png to the current directory. For scripted work, Puppeteer’s page.screenshot() is usually the clearest starting point.

Choose the capture method

Need Use What you get
One URL, one image Chrome Headless CLI Minimal setup and a documented --screenshot flag
Navigation, waits and file handling in JavaScript Puppeteer A high-level API, including page.screenshot()
One DOM element Puppeteer element screenshot ElementHandle.screenshot() for a selected element
Protocol-level control CDP PNG, JPEG or WebP, clipping, beyond-viewport capture and base64 data

These approaches differ mainly in setup, runtime, capture area, output handling and how you decide that the page is ready. None of the cited documentation establishes a universal speed winner.

Fastest option: Chrome Headless from a terminal

Capture a viewport

Install a Chrome build that supports the current Headless mode, then run:

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

Chrome saves screenshot.png in the directory where you run the command. Replace the URL and dimensions as needed. --window-size=WIDTH,HEIGHT sets the viewport used for the capture; omit it when the default viewport is acceptable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Allow a page to render

Chrome documents --timeout as a delay in milliseconds before headless screenshot, DOM-dump or PDF capture. For example:

chrome --headless=new --timeout=3000 --screenshot --window-size=1440,900 https://example.com/

A fixed delay only gives the page extra time; it does not prove that every asynchronous request, animation or lazy image has finished. If readiness matters, use Puppeteer waits or application-specific signals instead.

What the CLI does not solve

  • It is a single command rather than a reusable navigation workflow.
  • It does not provide Puppeteer’s element-selection API.
  • Output is the documented screenshot.png file, so choose Puppeteer or CDP when you need richer programmatic handling.

Automate Chrome with Puppeteer

Puppeteer is a JavaScript library for automating Chrome and Firefox, and Chrome’s overview lists screenshots among its uses. Install it in a Node.js project:

npm install puppeteer

Complete page screenshot

This follows the documented launch, navigation, screenshot and close sequence, with try/finally ensuring the browser is closed if navigation or capture fails:

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

Save this as an ES module (for example, a .mjs file) and run it with Node.js. page.goto() navigates Chrome, and page.screenshot() writes the image to the path you provide. Consult the current Page API reference for screenshot option names and behavior that match your installed Puppeteer version.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Capture one element

Use Puppeteer’s documented ElementHandle.screenshot() when the page contains a component rather than a full-page target:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com');
  const card = await page.waitForSelector('.pricing-card');
  if (!card) throw new Error('Element .pricing-card was not found');
  await card.screenshot({ path: 'pricing-card.png' });
} finally {
  await browser.close();
}

The selector must match an element on the loaded page. A missing selector should be treated as a failed capture, not silently saved as an empty image.

Make readiness explicit

Navigation completion and visual readiness are different. For pages that render after JavaScript runs, wait for a selector that represents the finished state, or use a deliberately chosen delay. Keep the condition tied to your page rather than assuming a universal number of milliseconds. The Puppeteer screenshots guide documents page and element screenshot workflows; option details can change with the installed release.

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

Full-page and output considerations

Puppeteer’s screenshot API supports screenshot options, but exact names and behavior are version-sensitive. Check the API reference for your installed version before relying on full-page capture, image format, quality, device scale or other options. Pinning a Puppeteer version in your project makes automated output easier to reproduce.

Use the Chrome DevTools Protocol directly

CDP is appropriate when your application already speaks to Chrome at protocol level and you do not want a higher-level wrapper. Send the Page.captureScreenshot command through an attached DevTools Protocol session. The response contains a data field with base64-encoded image data for JSON transport.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Capture formats and clipping

The protocol accepts format values png, jpeg and webp. JPEG quality can be set from 0 to 100. An optional clip describes the rectangle to capture, and the protocol supports an option to capture beyond the viewport. Convert the returned base64 string to bytes in your application and write those bytes to a file or return them from an API.

Version qualification

The live CDP Page reference is a rolling “tot” document. Match the command and option names to the Chrome version you deploy; protocol behavior can differ between versions.

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

Practical decision rules

Choose the CLI when

  • You need a quick image from a known URL.
  • A fixed viewport and the default PNG file are sufficient.
  • You prefer no application code for a one-off job.

Choose Puppeteer when

  • You need navigation, selector waits, element screenshots or repeatable Node.js jobs.
  • You want browser cleanup and file handling in one script.
  • Your team is comfortable maintaining a JavaScript dependency and its matching Chrome runtime.

Choose CDP when

  • Your service already manages a Chrome connection.
  • You need protocol-level clipping, beyond-viewport capture or direct control of image format.
  • Your code can handle base64 decoding and Chrome-version compatibility.

Reliability, performance and cost considerations

Keep browser lifecycles bounded

Close the browser in a finally block so an exception does not leave a Chrome process running. Reuse a browser within a controlled batch when your architecture permits it, but isolate jobs when pages may leak state or credentials. The supplied documentation does not provide a benchmark, so measure startup, navigation and image-writing time in your own environment.

Wait for the right condition

--timeout and arbitrary sleeps are useful when a page simply needs more time, but neither confirms that a specific image, chart or API response is ready. A selector representing the completed component is a stronger condition for that page. Treat timeouts, missing selectors and navigation failures as errors and record the URL and reason.

Control output deliberately

Use a fixed viewport when pixel dimensions matter. Select PNG for lossless output, JPEG when your workflow accepts lossy compression, or WebP where your consumer supports it; CDP documents all three. For large pages, consider clipping or beyond-viewport behavior explicitly rather than assuming the visible viewport is the whole document.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Understand local costs

Chrome Headless, Puppeteer and CDP are local software workflows. Their documentation does not establish a per-screenshot service price or a universal resource requirement. Your actual cost is the compute, storage and maintenance of the environment in which Chrome runs.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

No image appears after the CLI command

Check the current working directory for screenshot.png, confirm that the chrome executable is on your path, and verify the URL is complete. Use an absolute output-directory expectation in your surrounding script if another process changes directories.

The screenshot is blank or incomplete

The page may still be rendering. Increase --timeout for a simple CLI capture, or in Puppeteer wait for a page-specific selector before calling page.screenshot(). A delay cannot guarantee that all asynchronous content has completed, so inspect the page’s actual readiness signal.

Navigation or capture throws an exception

Keep the call inside try/finally, log the failing URL and error, and close the browser. For an element capture, verify that waitForSelector found the intended element and that the selector is not dependent on a transient class name.

CDP returns unusable data

Decode the response’s base64 data field rather than writing the text directly as an image. Confirm that the format, JPEG quality, clip coordinates and beyond-viewport option are supported by the Chrome version you are controlling.

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.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Output changes after an upgrade

Puppeteer screenshot options and CDP behavior are tied to installed versions. Pin and record your Puppeteer and Chrome versions, then recheck the relevant API reference when upgrading.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. A single GET request returns PNG, JPEG, WebP or PDF, while the service handles browser setup for you. 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 each response identifies the result with X-Page-Verdict and X-Billed headers.

The API includes full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper settings and page ranges, custom CSS and JavaScript, clicks, selector or network-idle waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools to Claude, Cursor and other MCP clients.

One-call examples

See the ScreenshotNeo documentation for the complete option list. The basic cURL request is:

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

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo’s Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free, and every feature is available on every plan. Sign up for the free plan to try the API without adding a card.

FAQ

Can I screenshot a page without displaying a browser window?

Yes. Chrome’s Headless mode runs without a visible window, and Puppeteer launches Chrome for automated navigation and capture.

Which method captures only a CSS-selected component?

Puppeteer’s ElementHandle.screenshot() is the documented route for a specific element. ScreenshotNeo also accepts a CSS selector for element capture.

What does CDP return instead of a file?

Page.captureScreenshot returns base64-encoded image data in the response’s data field; your application decides where to decode and store it.

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

Is a timeout the same as “page fully loaded”?

No. Chrome’s timeout is a delay before capture. It can help rendering finish, but only a page-specific readiness condition can establish that the content you need is present.

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.