October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Playwright Screenshot Is Cropped? Fix the Viewport and Page Size

Playwright screenshots show the visible viewport by default. Learn when to use fullPage, how to correct clip and viewport settings, and how scale or element captures can look cropped.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a Playwright screenshot looks cropped, first check what you asked it to capture: page.screenshot() captures the visible viewport by default. Use fullPage: true for the entire scrollable page, remove or correct an unintended clip, and set the viewport to the dimensions your page needs—preferably before navigation. Also confirm that you are not capturing a single element or mistaking high-DPI output for a crop.

Choose the area you actually want to capture

Playwright’s page.screenshot() captures the visible viewport by default; fullPage defaults to false. That means content below the current viewport is absent unless you request a full-page screenshot. A screenshot that ends at the viewport boundary is not necessarily a failure.

As an Amazon Associate I earn from qualifying purchases.

  • Visible viewport: Use page.screenshot() with no full-page option.
  • Whole scrollable page: Set fullPage: true. Playwright captures the page as if it were displayed on a very tall screen.
  • One rectangular region: Use clip only when you intentionally want a crop.
  • One element: Use an element or locator screenshot only when that element—not the whole page—is the subject.

For a full-page capture, the minimal fix is:

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

See the Playwright screenshot guide and the Page API reference for the installed version’s current options.

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

Check for an unintended clip

Look at the screenshot call for a clip option. It restricts the screenshot to a rectangle defined by x, y, width, and height. If you did not mean to crop the image, remove clip. If you did mean to capture a region, adjust its coordinates and dimensions to cover the intended area.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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
// Full viewport, with no rectangular crop specified
await page.screenshot({ path: 'page.png' });

If you need a deliberate rectangle, make its dimensions explicit and check that the origin and size fit the page area you intend to capture:

await page.screenshot({
  path: 'region.png',
  clip: { x: 0, y: 0, width: 800, height: 600 },
});

That example captures only the specified rectangle; it is not a full-page setting.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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

Set the viewport to the intended page dimensions

The viewport controls the browser’s visible page area and can affect responsive layout. Set it when creating the browser context, or resize an existing page with page.setViewportSize(). In most cases, choose the intended dimensions before navigating: Playwright notes that many websites do not expect phones to change size after navigation.

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

Set it on the context before creating the page

const browser = await chromium.launch();
const context = await browser.newContext({
  viewport: { width: 1280, height: 1024 },
});
const page = await context.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'page.png' });
await browser.close();

Resize an existing page before navigation

await page.setViewportSize({ width: 1280, height: 1024 });
await page.goto('https://example.com');
await page.screenshot({ path: 'page.png' });

For many sites, a viewport change after navigation can produce surprising results. Playwright’s page.setViewportSize() also resets the screen size. If you need to control screen and viewport independently, configure the context’s screen and viewport options instead. See the emulation guide and Page API reference.

Rank #3
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.

Distinguish viewport size from screenshot pixel scale

The screenshot scale option changes the output image’s pixel dimensions; it does not determine whether the image includes the whole page. In the Page API, device is the default: output pixels correspond to device pixels. css produces one output pixel per CSS pixel. On a high-DPI device, device can therefore create an image with more pixels than the CSS dimensions suggest.

If the screenshot contains the area you expect but its file dimensions seem unexpectedly large, check scale and the context’s deviceScaleFactor. Use scale: 'css' when you want output dimensions in CSS pixels:

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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
await page.screenshot({ path: 'page.png', scale: 'css' });

When using a device preset, inspect the final configuration: presets include emulation settings such as a viewport, and a later viewport setting may override it. The order of your context and page configuration matters.

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.

Make sure the screenshot targets the page, not an element

A locator or element-handle screenshot is bounded to that element, so it will not include the rest of the page. A scrollable element screenshot also shows only the content currently scrolled into view within that element. If you wanted the page, call page.screenshot(); if you wanted the entire scrollable page, add fullPage: true. Use an element screenshot only when that element is the intended subject. See the ElementHandle API reference for element screenshot behavior.

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

Diagnose the crop by its symptom

What you see What to check Likely adjustment
Only the initially visible screen appears fullPage is omitted or false Set fullPage: true for the whole scrollable page.
A clean rectangular section is missing The screenshot call includes clip Remove the clip, or revise its x, y, width, and height.
The page layout is narrower, shorter, or more responsive than expected Context viewport, later resize, or a device preset Set the intended viewport before navigation and check configuration order.
The screenshot file has more pixels than expected, but includes the right content scale and deviceScaleFactor Use scale: 'css' for one output pixel per CSS pixel.
Only one component appears, or a scrollable panel is cut off Element or locator screenshot; element’s scroll position Capture the page instead, or adjust the element’s scroll position if that element is the goal.

Common mistakes and fixes

  • Expecting a full page from the default call: The default is the visible viewport. Add fullPage: true for the whole scrollable page.
  • Leaving a sample clip in production code: Remove it for an uncropped page screenshot, or set the rectangle to the intended area.
  • Resizing after navigation and getting a different layout: Set the viewport on the context before creating the page, or resize before page.goto().
  • Mixing up screen and viewport: page.setViewportSize() resets screen size. Configure context screen and viewport separately if they need to differ.
  • Calling a locator screenshot when you need the page: Change to page.screenshot(); element screenshots are limited to element bounds.
  • Reading image pixel dimensions as CSS dimensions: Check screenshot scale and context deviceScaleFactor; choose scale: 'css' when CSS-pixel output is desired.

Or skip the browser setup

If you need screenshots without maintaining a Playwright browser flow, ScreenshotNeo provides a website screenshot API and MCP server. A GET request can return an image or PDF; the request below saves a WebP screenshot. See the API documentation for request options.

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 and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. 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 to try 1,000 screenshots a month with no card.

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

FAQ

Does fullPage: true change the browser viewport?

It requests a screenshot of the entire scrollable page rather than just the visible viewport. Set the viewport separately when you need a specific responsive layout.

Why is my full-page capture still missing part of a panel?

If the panel scrolls independently, a full-page page screenshot does not turn an element screenshot into a capture of all that element’s internally scrolled content. Check whether you are capturing the panel itself and which part of it is currently scrolled into view.

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

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.