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

If a Playwright full-page screenshot is too short or its pixel height does not match the page, first separate two problems: the document may not have rendered all its content, or the screenshot may be using different dimensions than you expect. Capture explicitly with fullPage: true and scale: 'css', then compare the document’s scroll height with the saved image’s pixel height.

Start with an explicit full-page capture

Use this while debugging:

await page.screenshot({
  path: 'page.png',
  fullPage: true,
  scale: 'css',
});

Playwright documents fullPage: true as capturing “the full scrollable page, instead of the currently visible viewport.” The default for fullPage is false, so leaving it out captures only the viewport. The documented default for scale is device; css uses one image pixel per CSS pixel, making the output easier to compare with DOM measurements. See the Playwright Page API.

Also check that you are not passing a clip rectangle that intentionally restricts the output to a fixed area. Clipping and full-page capture solve different problems.

Measure the page before capturing

Collect both body and document measurements immediately before the screenshot:

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
const dimensions = await page.evaluate(() => ({
  viewportHeight: window.innerHeight,
  bodyHeight: document.body.scrollHeight,
  documentHeight: document.documentElement.scrollHeight,
}));
console.log(dimensions);

await page.screenshot({ path: 'page.png', fullPage: true, scale: 'css' });

Compare documentHeight and bodyHeight with the PNG’s pixel height. This is a diagnostic comparison, not a guarantee that every page’s body and document heights are identical.

  • If both DOM heights are already shorter than expected, investigate what the application rendered and whether the content was ready.
  • If the DOM height is as expected but the image is short, isolate screenshot options, especially fullPage, clip, and scale.
  • If the image is approximately a device-pixel multiple of the CSS height, check whether device scale is affecting your comparison.

Check when content is rendered

Wait for the application state that means the page is genuinely ready, such as a relevant selector appearing. A navigation event alone may not mean that asynchronous application content has finished rendering.

For pages that reveal content as the user scrolls, scroll through the document before measuring and capturing, then verify that the newly revealed sections are present. Lazy loading is a page-specific possibility to investigate, not a universal Playwright cause.

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
await page.goto('https://example.com');
await page.locator('main').waitFor({ state: 'visible' });

// For pages that load sections during scrolling, exercise the page first.
await page.evaluate(async () => {
  const step = Math.max(1, window.innerHeight);
  for (let y = 0; y < document.documentElement.scrollHeight; y += step) {
    window.scrollTo(0, y);
    await new Promise(resolve => setTimeout(resolve, 100));
  }
  window.scrollTo(0, 0);
});

const height = await page.evaluate(() => document.documentElement.scrollHeight);
console.log({ height });
await page.screenshot({ path: 'page.png', fullPage: true, scale: 'css' });

The scrolling loop is an example for pages that load content on scroll; adjust its readiness condition and wait behavior to the application. It does not replace waiting for the page’s actual data or state.

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

Distinguish the document from a scrollable panel

A page’s document scroll height does not necessarily include the full contents of a nested panel that has its own scrollbar. Decide whether you need the whole document or that panel. Playwright’s API notes that a screenshot of a scrollable element shows only its currently scrolled content; an element screenshot is not automatically a full capture of that element’s scrollable contents. See the Page API.

  • For the entire document, use page.screenshot({ fullPage: true }).
  • For a component, use a locator or element screenshot when the visible element is the intended target.
  • For a deliberately bounded rectangle, use clip and treat its dimensions as intentional.
  • For a nested panel, inspect and manage that panel’s own scroll position rather than assuming the document capture expands it.

Keep the reproduction consistent

Set the intended viewport before navigation and hold it constant while comparing runs. Playwright device emulation configures viewport and screen parameters, and viewport values can be overridden. See Playwright emulation.

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.

Visual output can also vary with the host operating system, browser version, settings, hardware, power source, and headless mode. For a reliable comparison, reproduce with the same browser and environment as the baseline where possible; Playwright discusses these sources of variation in its visual comparisons guide.

Interpret the mismatch

What you observe Check first Reason
Image height is close to viewport height Confirm fullPage: true is passed fullPage defaults to false. Playwright Page API
Image height is about a device-pixel multiple of expected CSS height Check scale and device scale factor device counts device pixels; css counts CSS pixels. Playwright Page API
DOM scroll height is already too small Check rendered content, application readiness, and any lazy-loaded sections Full-page capture follows the scrollable page; confirm what the page exposes before capture. Playwright screenshot guide
A nested panel is incomplete Check whether the target is a scrollable element and its current scroll position An element screenshot of a scrollable element shows its currently scrolled content. Playwright Page API
Height changes between runs Hold viewport and browser environment constant Emulated viewport and rendering environment affect reproducibility. Emulation; visual comparisons

Common errors and fixes

The screenshot captures only the viewport

Cause: fullPage was omitted or set to false. Fix: pass fullPage: true explicitly.

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

The document measurement is already short

Cause: the page may not have rendered the expected content, or scroll-triggered sections may not have been loaded. Fix: wait for the application-specific ready state, inspect the DOM, and exercise scrolling if the page loads content on scroll.

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

The image is larger or smaller than the CSS measurement

Cause: the screenshot may be measured in device pixels rather than CSS pixels. Fix: set scale: 'css' when comparing image dimensions directly with CSS-pixel values.

The output has a fixed or unexpected boundary

Cause: a clip rectangle or a different target may be limiting capture. Fix: remove clipping for a full-document capture, or use an element/clip capture only when that smaller area is intended.

The result changes across machines or runs

Cause: the viewport or browser rendering environment differs. Fix: keep the viewport and browser setup consistent with the baseline and check whether the page’s content changes between runs.

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.
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 provides a website screenshot API, so a single GET request can return a screenshot without setting up a Playwright browser. For example, this cURL request saves a WebP capture of a page:

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 the request options. ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies page verdict and billing status in headers. Its MCP server includes tools for AI agents to take screenshots, get page information, and capture PDFs. The Free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up free for 1,000 screenshots a month with no card.

Frequently Asked Questions

Does fullPage: true expand a nested scrollable panel?

No. It captures the document’s scrollable page; a scrollable element screenshot shows the element’s currently scrolled content.

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

Should I compare screenshot height to window.innerHeight?

No. That is the viewport height. Compare the image with the document’s scroll height when diagnosing a full-page capture.

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.