Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Set full_page=True in Playwright Python’s page.screenshot() call. That captures the page’s full scrollable height instead of only the visible viewport. Add a path to save the image, or omit it to receive image bytes.
Capture the full page with Playwright Python
With a Playwright page already open and navigated, the essential call is:
page.screenshot(path="screenshot.png", full_page=True)
In an asynchronous project, await the same method:
await page.screenshot(path="screenshot.png", full_page=True)
Playwright’s Python screenshot guide describes a full-page screenshot as a screenshot of the full scrollable page, as if viewed on a screen tall enough to fit it. The API’s screenshot reference specifies that full_page is a boolean that defaults to false. Without explicitly setting it to True, a screenshot captures the current viewport rather than the entire scrollable page.
Runnable synchronous example
This script launches Chromium, opens a page, saves a full-page PNG and closes the browser:
#1 Best Overall
from playwright.sync_api import sync_playwright
url = "https://example.com"
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.goto(url)
page.screenshot(path="screenshot.png", full_page=True)
browser.close()
Use this form when the surrounding application is synchronous. If your program already creates and configures a page, you can use the screenshot call there instead of launching another browser.
Runnable asynchronous example
For an async application, use Playwright’s async API consistently and await navigation and capture:
import asyncio
from playwright.async_api import async_playwright
async def capture(url: str) -> None:
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
await page.goto(url)
await page.screenshot(path="screenshot.png", full_page=True)
await browser.close()
asyncio.run(capture("https://example.com"))
Do not mix the synchronous and asynchronous APIs within one flow. In an existing async application, call the coroutine from its event loop rather than using asyncio.run() inside an already-running loop.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Save an image file or work with bytes
Write directly to a file
When you pass path, Playwright writes the screenshot to that location. The file extension determines the screenshot format unless you explicitly provide a type. For example:
page.screenshot(path="screenshot.png", full_page=True)
The API reference lists PNG, JPEG and WebP as supported screenshot types. Choose an extension consistent with the format you want to produce.
Rank #2
Receive bytes for processing
Omit path to receive the image data in memory instead of saving it through the screenshot call:
image_bytes = page.screenshot(full_page=True)
In async code:
image_bytes = await page.screenshot(full_page=True)
The returned bytes can be stored or passed to another component for processing, such as an image comparison workflow. If you need a file later, write those bytes to your chosen destination.
Options that affect the capture
The screenshot call has options for how the image is produced. The following are useful when the defaults do not match the output you need; check the API reference for the full, version-specific signature.
Full-page extent
full_page=True requests the whole scrollable page. It is not the default: omit the argument or leave it false and the capture is limited to the viewport. Full-page capture is a tall image, not a series of separately returned viewport images.
File path and image type
Use path when the screenshot should be written directly to a file; the extension is used to infer the type. The documented formats are PNG, JPEG and WebP. When you need in-memory data, omit path and handle the returned bytes.
Rank #3
Scale
The scale option controls how CSS pixels map to image pixels. The API reference describes "css" as producing one output pixel per CSS pixel and "device" as producing one output pixel per device pixel. Device scaling can create larger images, particularly on high-density displays; choose according to whether you need CSS-sized output or device-resolution detail.
Animations and caret
Animation handling can affect whether a capture shows an animated element at a transient point or a stable state. The screenshot API provides an animations option, and a caret option controls whether a text caret is shown or hidden. Consult the API reference for their accepted values and behavior for your installed Playwright version; set them only when capture consistency or visible editing state matters.
Background and transparency
The omit_background option can omit the default white background for supported image output, allowing transparency where applicable. This is useful for assets intended to sit on another background, but not usually for a faithful web-page record. Confirm the format and downstream viewer support transparency before relying on it.
Make the page ready before taking the screenshot
A full-page setting controls the captured extent; it does not by itself guarantee that every part of a dynamic page has finished rendering or loaded its content. Navigate and wait for the condition your page actually needs before capturing.
- For ordinary navigation, wait for
page.goto()to return before callingscreenshot(). - If a particular component is essential, wait for that element or a meaningful page state rather than adding an arbitrary long delay.
- Pages that load content as the user scrolls may not have populated all lower sections merely because the browser can capture the scrollable page. Verify the resulting image; if necessary, trigger the page’s loading behavior before capture.
- Use the same browser context settings, viewport and page state between runs when you need comparable screenshots.
These steps address page readiness and repeatability; they do not change the meaning of full_page=True.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
Common problems and fixes
The screenshot stops at the viewport
Cause: the capture call omitted full_page=True or set it to false. Fix: pass full_page=True explicitly in the screenshot call. It is not the default.
The output is not saved where expected
Cause: the path is relative to the process’s working directory, or no path was supplied. Fix: use an explicit destination when needed, ensure the directory exists, and provide path. If you intentionally omit it, retain and write the returned bytes yourself.
The image type does not match the intended format
Cause: the saved-file extension infers the type, or an explicit type differs from your expected output. Fix: use a matching path extension or set the screenshot type in accordance with the API reference. The documented types are PNG, JPEG and WebP.
Lower sections are empty or missing content
Cause: the site may render or fetch content only after scrolling or after a component becomes visible. Full-page capture includes the scrollable area but does not guarantee that every lazy-loaded element was populated. Fix: wait for page-specific readiness and trigger the loading behavior required by the site before taking the screenshot.
The capture is unexpectedly large or slow
Cause: a long page produces a tall image, and device-scale output can multiply image dimensions. Fix: consider CSS-pixel scaling when device-pixel detail is unnecessary, capture only the required page or element if that meets the task, and avoid repeatedly capturing an unchanged large page.
Async code reports an await or event-loop error
Cause: synchronous calls were mixed into an async flow, or asyncio.run() was called from an already-running event loop. Fix: use playwright.async_api throughout and await the screenshot call from the application’s existing loop.
Performance, reliability and cost considerations
A full-page capture can be substantially larger than a viewport capture because it includes the page’s entire scrollable height. The time and memory involved depend on the rendered page and output dimensions; there is no single reliable size or duration for every site. If downstream systems have image-size limits, inspect the resulting dimensions and consider whether a viewport capture, a selected element, or a lower scale is sufficient.
For repeatable results, control the page state before capture: navigation completion alone may not mean that asynchronous content, fonts or images are ready. Choose a page-specific readiness condition and use consistent viewport and rendering settings. When comparing images, also keep timing-sensitive content such as animations in mind.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePlaywright is a browser automation approach: your application launches and operates a browser, so you manage that runtime and its execution environment. This gives control over page setup and capture options, but it also means failures can stem from browser launch, navigation, page behavior or output handling rather than the screenshot flag itself.
Or skip the browser setup
For a one-request screenshot API, ScreenshotNeo accepts a URL and returns a screenshot or PDF. The call below saves a WebP capture of the requested URL. See the ScreenshotNeo 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 as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides screenshot tools for AI agents, including Claude, Cursor and other 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.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsFrequently Asked Questions
How do I take a full-page screenshot in Playwright Python?
Call page.screenshot(full_page=True), adding path="screenshot.png" if you want Playwright to save a PNG file.
How do I save the screenshot as a file?
Pass a destination with path, for example page.screenshot(path="screenshot.png", full_page=True). The file extension determines the format unless you set a type explicitly.
Quick Recap
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.

