Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix 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 desk6 min

How to Capture Responsive Website Screenshots with Puppeteer

Set a responsive viewport before navigation, choose the right screenshot scope, and save comparable captures with Puppeteer.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To capture a responsive screenshot with Puppeteer, set the page’s viewport (or emulate a known device) before navigating, wait for the page state you need, then call page.screenshot(). Repeat with a distinct output file for each viewport you want to compare.

Capture a responsive viewport with Puppeteer

Install Puppeteer in your project, then save this as an ES module such as capture.mjs. It opens a page at a mobile-sized viewport and saves the visible viewport as a PNG.

As an Amazon Associate I earn from qualifying purchases.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.setViewport({
    width: 390,
    height: 844,
    deviceScaleFactor: 1,
  });
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'example-mobile.png' });
} finally {
  await browser.close();
}

Replace the URL and output path with your target page and desired filename. The example uses networkidle2 as a navigation wait condition; it is not a universal signal that every page’s content is ready. Choose a different condition or wait for a site-specific selector when the page continues making requests or renders important content later.

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

Capture several viewport sizes

For a breakpoint comparison, use the same URL and capture state for each size, and save each result to a distinct path. This loop produces three viewport screenshots:

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black | 1080p with auto-Light Correction, Built-in mic, Privacy Shutter, USB-A, Compatible with Teams, Google Meet, Zoom and More
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
import puppeteer from 'puppeteer';

const cases = [
  { name: 'mobile', width: 390, height: 844 },
  { name: 'tablet', width: 768, height: 1024 },
  { name: 'desktop', width: 1440, height: 900 },
];

const browser = await puppeteer.launch();
try {
  for (const size of cases) {
    const page = await browser.newPage();
    await page.setViewport({
      width: size.width,
      height: size.height,
      deviceScaleFactor: 1,
    });
    await page.goto('https://example.com', { waitUntil: 'networkidle2' });
    await page.screenshot({ path: `example-${size.name}.png` });
    await page.close();
  }
} finally {
  await browser.close();
}

Each page gets its viewport before navigation, avoiding a post-load resize as the basis for the capture. Keep the same URL, page state, wait strategy, capture scope, browser version, and device scale factor when you want to interpret differences as responsive-layout changes rather than capture-condition changes.

Set the viewport before navigation

Use page.setViewport() before page.goto() when testing CSS breakpoints by width and height. Puppeteer’s viewport documentation notes that changing viewport settings can resize the page and, in some cases when mobile or touch properties are changed, reload it. Setting the dimensions first gives the site the intended viewport during its initial load. See the Puppeteer setViewport API.

Viewport dimensions alone do not reproduce every named device. If the site responds to a device user agent or mobile metrics, use Puppeteer’s device preset and page.emulate() before navigation instead. The emulate API applies the preset viewport metrics and user agent.

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

Emulate a known device

import puppeteer from 'puppeteer';
import { KnownDevices } from 'puppeteer';

const device = KnownDevices['iPhone 13'];
const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.emulate(device);
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'example-iphone.png' });
} finally {
  await browser.close();
}

Use a device name present in KnownDevices for your installed Puppeteer version; available presets can change. A named-device capture and a width-only viewport capture answer different questions: emulation also uses that preset’s user agent.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Choose what part of the page to capture

page.screenshot() captures the current viewport by default. Choose a broader or more focused scope according to what the screenshot needs to show. The options and element method are documented in ScreenshotOptions and the ElementHandle screenshot API.

Capture scope How to use it When it fits
Current viewport await page.screenshot({ path: 'view.png' }) Show what is visible in one browser view.
Full page await page.screenshot({ path: 'full.png', fullPage: true }) Save the page from top to bottom. The resulting image may be much taller than a viewport screenshot.
Rectangle await page.screenshot({ path: 'region.png', clip: { x: 0, y: 0, width: 600, height: 400 } }) Focus on a defined region in page coordinates.
Element await page.$eval('.card', el => el.screenshot({ path: 'card.png' })) Capture one selected component. Puppeteer scrolls the element into view if needed; a detached element causes an error.

Use a viewport capture when the question is “what fits on this screen?” and a full-page capture when the page’s complete length matters. They are not interchangeable: full-page output can be much taller and does not show the same single-screen framing. For a focused component, an element screenshot avoids including unrelated page content.

Control image format and output

Puppeteer’s screenshot options include path, type, quality, omitBackground, clip, and fullPage. When saving to a path, the image type can be inferred from its extension. Check the documentation for your installed Puppeteer version before relying on a format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • PNG: suitable when you want lossless output. The quality option does not apply to PNG.
  • JPEG or WebP: where supported by your installed version, set the type or use a matching path extension; quality applies to non-PNG output.
  • Transparent background: set omitBackground: true to hide the default white background.
await page.screenshot({
  path: 'component.webp',
  type: 'webp',
  quality: 80,
  omitBackground: true,
});

Do not assume that every output format is supported in every installed Puppeteer version. Consult the current ScreenshotOptions documentation and your package version if an output type fails.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Wait for the page state you need

A responsive screenshot is only useful if the page has reached the state you intend to compare. Navigation wait conditions cover different points in loading; they do not guarantee that delayed application content, animations, or user-triggered elements have reached a desired state.

  • Use an appropriate waitUntil value in page.goto() for the site. Network-idle waiting may be unsuitable on pages with persistent requests.
  • If a component appears after client-side rendering, wait for a selector that represents that component before capturing.
  • Keep the same wait strategy and page state across viewport runs; otherwise timing differences can look like layout differences.

For before-and-after or breakpoint comparisons, record the URL, viewport width and height, device preset or user-agent emulation, device scale factor, capture scope, page state and timing, and output format. These controls make the conditions easier to interpret; they do not guarantee pixel-identical results across environments.

Troubleshoot common capture problems

The screenshot uses the wrong responsive layout

Set the viewport before page.goto(). If the site uses device-specific behavior beyond dimensions, emulate a known device before navigation instead of assuming a width alone reproduces it.

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

The screenshot is blank or misses content

The page may not have reached the state your capture needs. Revisit the navigation wait condition, then wait for the relevant selector or other site-specific readiness signal before calling screenshot(). Do not rely on network idle if the page keeps persistent requests open.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera | USB Type-A & A-to-C Adapter, Fixed Focus, Plug&Play for Zoom/Teams/Facetime/YouTube/Google Meet/Switch 2 Camera, 2025 Version
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

The element screenshot throws an error

Confirm the selector matches a live element at capture time. Puppeteer documents an error when the element handle is detached; if the page replaces that element during rendering, select it after the replacement has occurred.

The image is unexpectedly tall

Check whether fullPage: true is set. Remove it for a viewport capture, or keep it when the full document is the intended output.

The output format or quality setting has no effect

Verify the installed Puppeteer version’s supported image types and options. Quality applies to non-PNG output, not PNG; a path extension can determine the image type when no explicit type is supplied.

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

The capture changes or reloads after resizing

Configure the viewport or device emulation before navigation. Puppeteer notes that viewport changes can resize the page and that changing mobile or touch properties can reload it in some cases.

Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black | 30fps Video, Clear Audio, Light Correction, Works with Teams, Meet, Zoom, Nintendo Switch 2, Mac, Tablet
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
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 need screenshots without running and maintaining a local browser workflow, ScreenshotNeo accepts one GET request with a URL and returns an image or PDF. Its API supports viewport and device options, full-page and element captures, and many other capture controls. The complete request and option reference is in the ScreenshotNeo documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to start with 1,000 screenshots a month and no card.

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.

FAQ

Does a full-page screenshot show what a mobile user sees on screen?

No. It captures the page’s full length; use the default viewport capture to show one screen’s framing.

Does setting a mobile viewport reproduce a real phone?

Not necessarily. A viewport sets dimensions; device emulation also applies a preset’s metrics and user agent.

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

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.