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

Puppeteer offers different snapshot methods for different outputs: use page.screenshot() for an image, page.content() for serialized HTML, page.accessibility.snapshot() for an accessibility-tree view, and page.pdf() for a PDF. A normal screenshot captures the viewport; set fullPage: true to request the full page. The options below follow Puppeteer’s API reference labeled version 25.12.0; check the reference matching the version installed in your project.

Choose the snapshot method by output

What you need Puppeteer method What it returns or does
Visible page image page.screenshot() Captures the viewport by default.
Full-page image page.screenshot({ fullPage: true }) Requests an image of the full page rather than just the viewport.
One element as an image elementHandle.screenshot() Captures the element, scrolling it into view if necessary.
Serialized HTML page.content() Returns the page HTML, including the DOCTYPE.
Accessibility representation page.accessibility.snapshot() Returns the current accessibility-tree representation.
PDF page.pdf() Generates a PDF using print media by default.

These outputs are not interchangeable: choose an image for visual review, HTML for markup processing, an accessibility snapshot for inspecting the browser’s accessibility-tree view, or a PDF for document delivery. See the official Puppeteer screenshots guide.

Capture a viewport or full page

In the current ScreenshotOptions reference, labeled Puppeteer 25.12.0, fullPage defaults to false. Leave it unset for a viewport capture, or set it to true to request the full page.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
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: 'viewport.png' });
  await page.screenshot({ path: 'full-page.png', fullPage: true });
} finally {
  await browser.close();
}

networkidle2 is used in Puppeteer’s guide as an example readiness condition, not a guarantee that every application has finished rendering. Pick a navigation or application-specific readiness condition suited to the page’s asynchronous work, then inspect the actual capture.

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.

Screenshot options and when to use them

The API reference documents these options and defaults. Confirm edge cases against the reference for your installed Puppeteer release.

Option Use Default or qualification
fullPage Request capture of the full page rather than the viewport. false
clip Restrict capture to a rectangular page region. No default stated. The reference excerpt does not specify its full coordinate shape or every interaction with fullPage.
captureBeyondViewport Control capture beyond the viewport. false when there is no clip; true otherwise.
type Choose the image format. png. A file extension can determine type when saving with path.
quality Set image quality for a supported lossy format. 0–100; does not apply to PNG. The reference excerpt does not enumerate every accepted non-PNG format.
omitBackground Hide the default white background for transparency. false. Select a format that supports the transparency you need.
encoding Choose binary or base64 output. binary.
path Save the image to a file. Omitted means it is not saved to disk.
fromSurface Choose capture from the surface rather than the view. true.
optimizeForSpeed Request the speed-oriented capture option. false.

Capture only a region

Pass clip to limit the shot to a rectangular region. Its documented interaction with captureBeyondViewport changes the latter’s default to true when a clip is supplied. If the desired behavior depends on capturing outside the viewport, set captureBeyondViewport explicitly and verify the combination with the API reference for your installed version.

Choose format, quality, and transparency

PNG is the default, and the quality option does not affect PNG. For a supported lossy format, set type and a quality value from 0 to 100. To remove the default white background, use omitBackground: true and a format that preserves transparency.

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.

Save to disk or use the returned data

Set path to write the screenshot to a file. Without it, Puppeteer does not save the image to disk. Without base64 encoding, page.screenshot() returns a Uint8Array; with encoding: 'base64', it returns a string. The Page.screenshot() API reference also notes that, while a screenshot is being taken in a BrowserContext, calls to newPage() and close() wait for it to finish; bringToFront() does not.

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

Capture one DOM element

Use an element handle’s screenshot() method when the target is a single DOM element rather than a page region. Puppeteer scrolls the element into view if needed. The element must remain attached to the page through the capture; a detached target causes an error.

const element = await page.waitForSelector('#receipt');
if (!element) throw new Error('Receipt element was not found');
await element.screenshot({ path: 'receipt.png' });

See ElementHandle.screenshot() for the method reference.

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.

Save HTML or inspect the accessibility tree

HTML snapshot

Call page.content() when you need serialized page HTML rather than pixels. The returned string includes the DOCTYPE.

const html = await page.content();
await fs.promises.writeFile('page.html', html, 'utf8');

See the Page.content() API reference.

Accessibility snapshot

Call page.accessibility.snapshot() for Puppeteer’s current accessibility-tree representation. By default, interestingOnly is true, which filters out nodes considered uninteresting. Set it to false to request the full tree. The includeIframes option defaults to false; root can scope the snapshot to an element.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const tree = await page.accessibility.snapshot({
  interestingOnly: false,
  includeIframes: true,
});
console.log(tree);

This is a browser accessibility-tree view, not a promise of identical output across operating systems or screen readers. Puppeteer’s API describes accessibility as platform-specific and its default filtering as an approximation. See Accessibility.snapshot().

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

Generate a PDF

page.pdf() generates a PDF using print media by default. If the PDF should reflect screen styles instead, call page.emulateMediaType('screen') before generating it.

await page.emulateMediaType('screen');
await page.pdf({ path: 'page.pdf' });

Consult the Page class API reference for PDF options. That reference is under the next path; its version status is not independently verified here, so check the API matching your installed version.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For a hosted screenshot API, ScreenshotNeo takes a screenshot or PDF with one GET request. Its capture can accept cookie banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses include X-Page-Verdict and X-Billed headers. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.

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

Example cURL request (replace the key and target URL):

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.
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 API documentation for request parameters and response details.

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.

Troubleshoot common capture problems

  • The screenshot shows only the visible area: fullPage defaults to false. Set fullPage: true when you want the full page.
  • The element screenshot fails: the element may have been detached before capture. Wait for the target, avoid replacing it during the call, and capture while its handle remains attached.
  • The image looks blank or incomplete: the page may not have finished its asynchronous work when capture began. Choose a suitable navigation readiness condition or wait for an application-specific selector, then inspect the result. networkidle2 is an example in the guide, not a universal guarantee.
  • The clipped output does not cover the expected area: check the clip and captureBeyondViewport combination. The documented default for the latter differs depending on whether a clip is supplied.
  • The PNG looks unchanged after setting quality: quality does not apply to PNG. Use a supported lossy format if quality adjustment is required.
  • The background is still opaque: set omitBackground: true and use an image format that supports transparency.
  • The PDF uses unexpected styling: PDF output uses print media by default. Emulate screen media before page.pdf() if screen styles are intended.

Performance, reliability, and cost considerations

The official references describe capture options and certain API behaviors, but do not establish comparative speed, image-size savings, cross-browser parity, or reliability benchmarks. Treat optimizeForSpeed as an available option rather than a measured performance guarantee. For repeatable captures, make readiness conditions explicit, choose only the output and scope you need, and validate results against your application’s rendering behavior. Puppeteer’s methods run within your browser setup; a hosted API such as ScreenshotNeo avoids setting up that browser capture flow, with billing and response verdicts described above.

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.

Frequently Asked Questions

Does Puppeteer’s full-page screenshot include lazy-loaded images?

The cited ScreenshotOptions and screenshot-guide material establishes that fullPage requests a full-page capture, but does not establish that lazy-loaded content is forced to load. Handle any page-specific lazy loading before capture and verify the output.

Can I use an accessibility snapshot as a substitute for a screenshot?

No. It represents the browser accessibility tree rather than rendered pixels. Use page.screenshot() when the output you need is an image.

Which Puppeteer version do these screenshot option defaults describe?

The cited ScreenshotOptions and Page.screenshot API pages are labeled Puppeteer 25.12.0. Check the matching documentation for the version installed in your project.

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.