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

Set full_page=True on Playwright Python’s page.screenshot() method. With a file path, Playwright writes the complete scrollable page to disk; without a path, it returns the image as bytes. The option is available in both synchronous and asynchronous APIs.

The one-line fix

Once you have a Playwright Page object, use:

page.screenshot(path="screenshot.png", full_page=True)

For asynchronous code, await the same operation:

await page.screenshot(path="screenshot.png", full_page=True)

Playwright’s Python screenshot guide describes a full-page capture as a screenshot of the full scrollable page, “as if you had a very tall screen and the page could fit it entirely.” The API reference says full_page defaults to False, so omitting it captures only the current viewport.

What “full page” captures

A normal screenshot represents what is visible in the browser viewport. Setting full_page=True changes the capture area to the page’s scrollable height. It is not a second navigation and it does not create a PDF; it produces a PNG, JPEG, or WebP image, depending on the requested type or filename.

  • Viewport capture: the visible browser area; this is the default.
  • Full-page capture: the entire scrollable document, including content below the fold.
  • Element capture: not implied by full_page; use an element-specific screenshot method when you need only one component.

“Full” refers to the scrollable document, not necessarily every visual state a user could reach. A page that renders content only after interaction, waits for an API response, or uses an infinite feed may need additional preparation before the screenshot call. A fixed header can appear at the top of the image, and a very tall document can produce a large image that consumes substantial memory.

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.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Install Playwright and create a page

Install the Python package and at least one browser engine in the environment that will run your script:

python -m pip install playwright
playwright install chromium

The screenshot method runs against an already-created Page. The following setup is a minimal, illustrative combination of the documented screenshot call and common Playwright Python usage:

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    page.goto("https://example.com")
    page.screenshot(path="screenshot.png", full_page=True)
    browser.close()

Replace the URL and output filename with your own values. In production, close the browser in a finally block if later work can raise an exception, so browser processes are not left running.

Synchronous Python: a complete capture

The synchronous API is convenient for scripts, command-line jobs, and test utilities that do not already use an event loop.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from pathlib import Path
from playwright.sync_api import sync_playwright

URL = "https://example.com"
OUTPUT = Path("artifacts/example-full.png")

with sync_playwright() as p:
    browser = p.chromium.launch()
    try:
        page = browser.new_page()
        page.goto(URL)
        page.screenshot(path=str(OUTPUT), full_page=True)
        print(f"Saved {OUTPUT}")
    finally:
        browser.close()

Ensure the parent directory exists before writing. For a one-off script, create it with OUTPUT.parent.mkdir(parents=True, exist_ok=True) before the browser context starts.

Waiting for content before capture

Navigation returning does not always mean an application has finished rendering. If the page fills a results area after JavaScript runs, wait for a specific element or application state that proves the content is ready, then call screenshot. A fixed sleep can work for a controlled demo but is less reliable than waiting for a meaningful selector or state. Do not hide a permanently missing element behind an excessively long timeout; diagnose the page instead.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Pages with lazy or interactive content

A full-page screenshot expands the capture area, but it does not know which button should be clicked, which tab should be selected, or whether an infinite list should keep loading. Perform those interactions first, verify the resulting DOM, and then capture. For an infinite-scroll page, define a stopping condition such as a known item count or an end marker; otherwise the page may continue growing while you capture.

Asynchronous Python

Use the async API consistently inside an async application. Every browser, page, navigation, and screenshot operation must be awaited.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import asyncio
from playwright.async_api import async_playwright

async def capture(url: str, output: str) -> None:
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        try:
            page = await browser.new_page()
            await page.goto(url)
            await page.screenshot(path=output, full_page=True)
        finally:
            await browser.close()

asyncio.run(capture("https://example.com", "example-full.png"))

A common failure is mixing APIs—for example, calling the synchronous Playwright interface from a running asyncio loop or forgetting await on page.screenshot(). Pick one style for the whole call chain.

Save an image file or keep the bytes

The path argument controls whether Playwright writes the result. When a path is supplied, the image format is inferred from its extension. The API reference lists PNG, JPEG, and WebP screenshot types.

# Write a file; extension determines the format
page.screenshot(path="page.webp", full_page=True)

# Return bytes instead of writing to disk
image_bytes = page.screenshot(full_page=True)

The asynchronous equivalent returns bytes after awaiting:

image_bytes = await page.screenshot(full_page=True)

Bytes are useful when you want to upload directly to object storage, pass the image to a pixel-diff library, or apply an image-processing step without creating a temporary file. If another API requires a file-like object, wrap the bytes in an in-memory buffer such as io.BytesIO.

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
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Choosing PNG, JPEG, or WebP

  • PNG: a lossless choice for text, interfaces, and pixel comparisons.
  • JPEG: useful when a smaller photographic image is more important than lossless edges.
  • WebP: a modern option when your downstream tools accept it.

If you need an explicit type rather than extension inference, use the screenshot API’s type option with a supported format. Keep the extension and declared type aligned so later consumers do not misinterpret the file.

Screenshot options that matter

Option What it controls Default or supported values
full_page Captures the full scrollable page instead of the viewport. False by default; set True for a full-page image.
path Writes the image to a file. Omit it to receive bytes.
type Selects the image encoding. PNG, JPEG, or WebP.
scale Controls screenshot scaling. The supplied API excerpt names this option but does not state its value set.

Other page settings still affect the result. The viewport size determines how responsive CSS lays out the page; browser context settings determine such things as device emulation and color scheme. Configure those before navigation when the screenshot must represent a particular device or theme.

Make captures repeatable

Use a deterministic viewport

Responsive breakpoints can change line wrapping, navigation, and image dimensions. Set an explicit viewport in the browser context instead of relying on a developer machine’s defaults. Reuse the same viewport and device settings for visual regression jobs.

Wait for fonts and images

Capture only after the important content is present. If a web font swaps after the initial paint, the screenshot can contain different line breaks from a later run. Likewise, an image element can exist before its source has loaded. Wait for the page state your test cares about and, when appropriate, verify image dimensions or a loaded-state marker.

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

Neutralize animation

Animated carousels, blinking carets, and transitions can make two otherwise identical captures differ. For visual comparisons, inject a test stylesheet or application flag that disables transitions and animations before taking the screenshot. Keep that change limited to the capture context so you do not alter normal user behavior.

Handle sticky elements deliberately

A sticky navigation bar may remain visible while the page is scrolled and can overlap content in a long image. Decide whether that is the behavior you want to document. If not, hide or restyle the element in a capture-only CSS override, and record the override with the test so future maintainers understand why the image differs from the live page.

Troubleshooting

“Browser executable not found”

The Python package is installed, but the browser binary is not available to the current environment. Run the Playwright browser installation command shown above, then verify that the same virtual environment executes the script.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

The image contains only the viewport

Check the call itself: full_page=True must be passed to page.screenshot(). Also confirm that the page actually has scrollable content; a short document will look the same in viewport and full-page modes.

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

Content is missing below the fold

The application may render that content only after a delay, a selector becomes visible, a click, or scrolling. Reproduce the required user action in the script, wait for a concrete ready condition, and capture afterward. For an infinite feed, establish a finite stopping rule.

The script hangs during navigation

Separate navigation problems from screenshot problems. Try opening the URL in the same environment, inspect whether it requires authentication or a consent action, and wait for a page-specific readiness condition rather than assuming the network is completely idle. Keep navigation and screenshot timeouts bounded in automated jobs so a failed site cannot consume workers indefinitely.

The output file cannot be opened

Check the destination directory, file permissions, and extension. If you supplied a path, Playwright infers the format from that extension; use one of the documented PNG, JPEG, or WebP forms. When returning bytes, make sure the receiving code writes the complete byte string in binary mode.

Async warnings or coroutine errors

Use await page.screenshot(...) with playwright.async_api. Do not call the synchronous API from an active asyncio loop, and do not discard the coroutine returned by an async method.

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

Captures are too large or slow

A very tall page naturally produces a large bitmap. Reduce unnecessary page content, capture a relevant element when a whole document is not required, or choose an output format and scale appropriate for your downstream use. For batch jobs, reuse a browser process where practical while creating isolated contexts or pages for separate targets.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

Full-page capture work is bounded by the page’s rendering time, document height, image assets, and available memory. A local Playwright run has no per-screenshot service charge, but your CI runner, container, or server still pays the CPU, memory, bandwidth, and browser-startup costs. Launching one browser per URL is simple but expensive at scale; a long-lived worker can amortize startup while still closing pages and contexts after each job.

  • Set an explicit output directory and retain only the artifacts your workflow needs.
  • Record the URL, viewport, browser version, and capture timestamp beside visual-regression artifacts.
  • Retry transient navigation failures selectively; do not blindly retry deterministic selector or authentication errors.
  • Keep secrets out of URLs and screenshot filenames, and protect captured pages that contain private data.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request returns a PNG, JPEG, WebP, or PDF, so you do not need to install a browser or maintain a Playwright worker. See the ScreenshotNeo documentation for the full parameter list.

For a direct image response:

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

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts cookie and consent banners as a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools to Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots, and every feature is available on every plan.

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

Sign up for the free 1,000-screenshot plan and try the API without adding a card.

Frequently Asked Questions

How do I capture only the visible viewport in Playwright Python?

Leave full_page at its default value of False, or pass full_page=False explicitly.

Can a full-page screenshot be returned without creating a file?

Yes. Omit path; the synchronous method returns bytes directly, while the asynchronous method returns them after await.

Which image formats does Playwright support for screenshots?

The API reference lists PNG, JPEG, and WebP. A supplied path normally determines the format from its extension.

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

Why does a page with infinite scrolling never produce a stable full-page image?

Infinite-scroll pages have no fixed final document height. Trigger loading deliberately and stop at a defined item count or end marker before calling the screenshot method.

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.