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

Set the viewport before navigation, then capture the page with page.screenshot(). For example, a viewport of 1280 × 720 CSS pixels and a deviceScaleFactor of 2 produces a screenshot with a higher pixel density while preserving that CSS viewport. Those numbers are illustrative; choose dimensions and scale to match the layout and output you need.

Set the viewport before navigating

Use page.setViewport() to define the viewport’s CSS-pixel width and height and its device scale factor. Set it before page.goto() so the page loads against the metrics you intend to capture. Puppeteer’s viewport API documents that page.setViewport resizes the page.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.setViewport({
    width: 1280,
    height: 720,
    deviceScaleFactor: 2,
  });

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

The example uses illustrative values, not a universal viewport recommendation or a tested result. The width and height describe the page’s CSS-pixel viewport; deviceScaleFactor sets the output pixel density. Choose values appropriate for the target site and the image dimensions you need.

The example uses ECMAScript modules and assumes Puppeteer is installed in the project. For reproducibility, record the Puppeteer version used: the documentation consulted for this guide was indexed as version 25.12.0, and API details can change between releases.

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

Choose the screenshot area

Viewport size and screenshot scope are separate settings. By default, page.screenshot() captures the current viewport. To capture the full page, set fullPage: true; use clip when you want a particular rectangle. The Puppeteer screenshots guide documents Page.screenshot() as the capture method.

// Viewport screenshot (the default scope)
await page.screenshot({ path: 'viewport.png' });

// Entire page
await page.screenshot({ path: 'full-page.png', fullPage: true });

// A rectangular region
await page.screenshot({
  path: 'region.png',
  clip: { x: 100, y: 120, width: 600, height: 400 },
});

The documented default for fullPage is false. Use the scope that matches your goal: a fixed viewport does not automatically mean a full-page capture.

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

Choose output format and readiness

Save a file or use the returned image data

Set path to save the screenshot to a file. Without a path, the screenshot API can return image bytes for use in your program. Puppeteer’s screenshot options also include type, encoding, quality, and omitBackground. Quality applies to JPEG and WebP, not PNG; consult the screenshot options reference for option details and defaults.

Wait for the page state you need

The sample waits for networkidle2, which is also used in the official guide’s example. It is a readiness condition, not proof that every animation, lazy-loaded image, or application update has finished. If the element you need appears later, wait for a meaningful selector or another site-specific condition before capturing.

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.
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.

Use a device profile when matching a device

If the goal is to reproduce a named device rather than specify custom metrics, page.emulate(device) sets user-agent and viewport metrics together. Call it before navigation, as described in Puppeteer’s emulation API. Use custom setViewport() values when you want direct control over width, height, and scale factor; use a device profile when its combined metrics and user agent are what you need.

Troubleshoot common mismatches

  • The layout has the wrong breakpoints: check that the width and height are the intended CSS-pixel values and that setViewport() ran before goto().
  • The output dimensions or density are unexpected: confirm the deviceScaleFactor and distinguish it from the CSS viewport dimensions.
  • The screenshot cuts off content: the default captures the viewport. Set fullPage: true for the whole page, or define a clip rectangle for a region.
  • Content is missing or still changing: navigation completion alone may not mean that dynamic content is ready. Wait for the page condition or element relevant to your capture.
  • You need device-specific rendering: custom viewport metrics alone do not set a matching user agent. Use page.emulate(device) before navigation when a named profile is appropriate.
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 one-request screenshot, ScreenshotNeo accepts a URL and returns an image or PDF. See the ScreenshotNeo API documentation for parameters, including viewport and device options.

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

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 screenshots 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.

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.

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.