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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
JavaScript

How to Capture a Full-Page Screenshot with Playwright

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

To capture an entire webpage with Playwright, use the page-level screenshot method and enable full-page capture: await page.screenshot({ path: 'screenshot.png', fullPage: true }); in JavaScript or TypeScript, and page.screenshot(path="screenshot.png", full_page=True) in Python. This captures the page’s full scrollable content, not the browser’s outer window or just the part currently visible on screen.

What Playwright means by a “full browser window” screenshot

In Playwright, the relevant feature is called a full-page screenshot. It captures the full scrollable page as though the page were displayed on a screen tall enough to show all of it at once. A normal page screenshot captures the current viewport instead. The distinction matters: increasing the browser window size is not the same as asking Playwright to capture the full document. See the official Playwright screenshot guide and Page API.

The screenshot is of webpage content. It is not a picture of the browser’s tabs, address bar, toolbar, or operating-system window. The options differ slightly by language: JavaScript and TypeScript use fullPage: true; Python uses full_page=True. The method belongs to a page object, so first launch a browser, create a page, and navigate to the target URL.

JavaScript: save a full-page screenshot to a file

Install Playwright and its Chromium browser if they are not already available in your project:

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.
#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
npm install playwright
npx playwright install chromium

Then save the following as screenshot.js and run node screenshot.js. Replace the example URL with the page you want to capture.

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  try {
    const page = await browser.newPage({
      viewport: { width: 1280, height: 720 }
    });

    await page.goto('https://example.com');
    await page.screenshot({
      path: 'screenshot.png',
      fullPage: true
    });
  } finally {
    await browser.close();
  }
})().catch(error => {
  console.error(error);
  process.exitCode = 1;
});

The screenshot call is the essential part: page.screenshot captures a page, and fullPage: true tells Playwright to include the full scrollable page. The explicit viewport makes the page’s initial responsive layout repeatable; the browser API documents a default viewport of 1280×720, while setting the viewport to null makes its size depend on the host window. That host-dependent choice can make responsive layouts vary between environments. See the Browser API.

The example uses page.goto with its default navigation behavior. If a site needs more time before the content you care about appears, decide what readiness condition makes sense for that page rather than assuming navigation alone means every visual element is ready. For repeatable work, use the same URL, viewport, and page state for each capture. The screenshot guide shows the full-page option; it does not promise identical output for sites whose content or layout changes over time.

Python: save a full-page screenshot

Install the Python package and a browser supported by Playwright:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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
pip install playwright
playwright install chromium

Save this as screenshot.py, change the URL as needed, and run python screenshot.py:

from playwright.sync_api import sync_playwright

with sync_playwright() as playwright:
    browser = playwright.chromium.launch()
    try:
        page = browser.new_page(
            viewport={"width": 1280, "height": 720}
        )
        page.goto("https://example.com")
        page.screenshot(
            path="screenshot.png",
            full_page=True
        )
    finally:
        browser.close()

In asynchronous Python, await the screenshot call. The Python screenshot guide documents both the full-page option and screenshot bytes: Playwright for Python: Screenshots.

from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as playwright:
        browser = await playwright.chromium.launch()
        try:
            page = await browser.new_page(
                viewport={"width": 1280, "height": 720}
            )
            await page.goto("https://example.com")
            await page.screenshot(
                path="screenshot.png",
                full_page=True
            )
        finally:
            await browser.close()

Run an async script with an event-loop entry point:

import asyncio

asyncio.run(main())

Add that entry point after the function definition. If you are using the synchronous API, do not add await; if you are using the asynchronous API, include it for navigation and capture. Use the API style that fits the rest of your program.

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.

Choose file output or image bytes

Pass path when you want Playwright to write the screenshot to a file. The file extension can be used to infer the image type. If you omit the path, the screenshot method returns image data for your program to store, process, or send elsewhere. JavaScript returns a buffer; Python returns bytes. The available format and screenshot options are documented in the language-specific screenshot guides: JavaScript and TypeScript and Python.

// JavaScript: keep the image data in memory
const imageBuffer = await page.screenshot({ fullPage: true });
# Python: keep the image data in memory
image_bytes = page.screenshot(full_page=True)

Choose one output approach for each capture: write to a path if a file is the intended result, or omit it when the calling code should handle the returned data. A path is useful for a local artifact; bytes are useful when the next step in your workflow accepts in-memory image data. The capture scope remains full-page in either case.

Full page, viewport, or one element?

Capture scope What it targets When to choose it
Viewport The currently visible page area When you need a screenshot of what fits in the current viewport.
Full page The page’s full scrollable content When the output should include content below the initial viewport.
Element A matched page element When you need a specific component, such as a header, rather than the whole page.

For an element, use a locator screenshot, for example:

await page.locator('.header').screenshot({ path: 'header.png' });

A locator screenshot is not a shortcut for capturing every item inside a scrollable container: Playwright’s Locator API says that only the content currently scrolled into view is visible in that case. Choose the page-level full-page screenshot for the full scrollable page, and the locator method when the matched element itself is the intended subject. See the Locator API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
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

Make captures more consistent

Set a deliberate viewport

Viewport dimensions affect responsive rendering: the same page can arrange its content differently at different widths. Set a viewport explicitly when screenshots need comparable layout across runs or machines. Playwright documents a 1280×720 default viewport; a viewport of null depends on the host window and is therefore not a fixed size. Neither choice guarantees that a page’s content will remain unchanged, but a deliberate size removes one avoidable source of layout variation.

Decide what “ready” means for the page

A page can continue changing after navigation—for example, a page may populate content after its initial document appears. Choose a wait condition that matches the target site and the content being captured. If the image is missing expected content, first check whether that content had appeared by the time the screenshot ran. Avoid treating a screenshot as proof that every part of a site has loaded: the cited screenshot APIs describe capture behavior, not a universal readiness guarantee.

Keep full-page output in proportion to the task

Full-page capture can produce a much taller image than a viewport capture. If the consumer only needs an above-the-fold preview, use the ordinary page screenshot instead. If it needs the complete page, retain fullPage: true or full_page=True. Pick an image format and destination appropriate to what will consume the output; Playwright’s guides explain the supported screenshot options, but the best output choice depends on your downstream workflow.

Troubleshooting a full-page screenshot

  • The screenshot stops at the visible area: Confirm that you used the page-level screenshot method and set the correctly cased option for your language: fullPage: true for JavaScript/TypeScript or full_page=True for Python. A screenshot without that option captures the viewport.
  • The layout changes between runs: Set an explicit viewport instead of relying on a host-dependent window size. Responsive pages can render differently at different dimensions.
  • Expected content is absent: Check whether the target content was present when capture ran and whether navigation or the page-specific readiness condition was sufficient. The screenshot method captures the page state available to it; it does not itself establish that every site has finished loading dynamic content.
  • An element screenshot omits part of a scrollable panel: This is a different capture scope. For a scrollable element, the Locator API specifies that only its currently scrolled content is visible. Use the page-level full-page capture if the goal is the full page rather than that element’s current visible portion.
  • The file is not where you expected: Check the path you supplied and the working directory from which the script runs. If you omit path, handle the returned buffer or bytes instead of expecting a file to be written.
  • Behavior differs from an example: The cited Playwright pages are current documentation, but they do not pin a specific installed Playwright release. Check the documentation for the version installed in your project when version-specific behavior matters.
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 an API call rather than running Playwright and a browser yourself, ScreenshotNeo takes a URL in one GET request and returns a screenshot or PDF. Its clean-shot steps accept cookie or consent banners like a visitor and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in headers. It also provides an MCP server for AI agents, including Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

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

For example, this cURL request saves a WebP capture:

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

Python and Node.js versions, along with the available options, are in the ScreenshotNeo documentation. One call can request a clean capture without you launching a browser or writing a page-navigation script. Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month with no card.

Further reading

Frequently Asked Questions

Does full-page capture mean Playwright resizes the visible browser window?

No. It captures the page’s full scrollable content; it is not a screenshot of the browser window frame or a request to enlarge the operating-system window.

Which Playwright release do these examples require?

The cited documentation does not specify a pinned release. Check the official API documentation for the version installed in your project if behavior is version-sensitive.

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

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.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
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.