Use Playwright’s Python page.screenshot() method with full_page=True to capture the page’s full scrollable content rather than just what fits in the current viewport. Choose the synchronous or asynchronous API to match your program, and set the browser context’s viewport separately if the page’s rendering dimensions matter.
Capture a full page with synchronous Playwright Python
Install Playwright and its browser binaries if they are not already available in your Python environment. The following standalone example launches Chromium, opens a page, saves a full-page PNG, and closes the browser:
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()
The important argument is full_page=True. Without it, the screenshot is limited to the visible viewport. With it, Playwright captures the full scrollable page as if it were displayed on a very tall screen. Playwright’s screenshot guide documents this behavior.
Use the asynchronous API when the rest of your code is async
In an async application or test, use Playwright’s async API and await navigation and capture. This complete example saves the result to the same kind of file:
#1 Best Overall
- 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
import asyncio
from playwright.async_api import async_playwright
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
await page.goto("https://example.com")
await page.screenshot(path="screenshot.png", full_page=True)
await browser.close()
asyncio.run(main())
Keep the API style consistent: synchronous calls do not use await; asynchronous calls do. For a single capture, either is suitable. In an existing async service, use the async form rather than trying to run synchronous Playwright inside its event loop. The documented sync and async screenshot forms are in the official screenshot guide.
Set rendering dimensions independently from capture scope
The viewport controls the browser’s rendering conditions; it does not decide whether the screenshot includes below-the-fold content. full_page=True controls capture scope. If you need a reproducible desktop layout, define the viewport on the browser context before navigation:
Rank #2
- 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
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch()
context = browser.new_context(
viewport={"width": 1280, "height": 1024},
device_scale_factor=2,
)
page = context.new_page()
page.goto("https://example.com")
page.screenshot(path="screenshot.png", full_page=True)
browser.close()
The official emulation guide shows context-level viewport and device-scale settings, including a 1280×1024 viewport and scale factor of 2. Set these before navigation where practical, since page layout may respond to viewport size. A device scale factor changes the emulated display density; it is separate from the page’s CSS viewport dimensions. If you change viewport dimensions later with page.set_viewport_size(), Playwright also resets screen size; use context-level screen and viewport settings when both need precise control.
Choose a file, bytes, format, or a single element
Save to a path or keep the returned bytes
Passing path writes the screenshot to a file. If you omit it, page.screenshot() returns image bytes, which you can pass to another library or encode for an API:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
- 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.
image_bytes = page.screenshot(full_page=True)
# Pass image_bytes to your image-processing or storage code.
The screenshot guide demonstrates using returned bytes for downstream handling. When a particular image format matters, choose it explicitly using the screenshot API’s documented options; PNG is a lossless option. Check the Page API reference corresponding to your installed Playwright release for format, scale, timeout, masking, and other options, because the linked API reference is under the versioned /next/ path and may describe a different release.
Capture one element instead of the entire page
If you need only a chart, card, or other element, take a locator screenshot rather than a full-page screenshot:
Rank #4
- 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
page.locator("main .report-card").screenshot(path="report-card.png")
A locator screenshot scrolls the element into view. For an element inside a scrollable container, it captures only the container content currently visible, not the container’s entire scrollable contents. Locator screenshot options include output scale and animation behavior; see the Locator API reference for details matching your installed version.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Wait for the content your screenshot needs
Navigation completing does not guarantee that a site’s client-rendered or lazy-loaded content is ready. The right readiness condition depends on the application. If the page has a reliable selector that appears when the target content is ready, wait for that selector before capture:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Best Value
- 【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.
page.goto("https://example.com")
page.locator(".report-ready").wait_for()
page.screenshot(path="screenshot.png", full_page=True)
For async code, await the locator wait and screenshot. Avoid treating one generic delay as proof that every page has finished rendering; prefer an application-specific readiness signal when available. The screenshot guide does not prescribe a universal wait strategy for dynamic sites.
Capture full-page screenshots on pytest failures
For tests using Playwright’s pytest plugin, enable screenshots and request full-page captures with the plugin’s command-line options:
pytest --screenshot=only-on-failure --full-page-screenshot
The --full-page-screenshot option requires --screenshot. By default, failure screenshots capture only the viewport. See the Playwright pytest documentation for the plugin’s screenshot options.
Troubleshooting full-page captures
- The image stops at the fold: confirm the call uses
full_page=True. A default screenshot captures only the viewport. - Content is missing or still loading: wait for a selector or other readiness condition tied to the content you need. A completed navigation alone may not mean a dynamic page is ready.
- The layout differs from the expected device: configure the context viewport and, if needed,
device_scale_factorbefore navigating. These are rendering settings, not substitutes forfull_page=True. - A nested scrolling area is cut off: a full-page capture concerns the page’s scrollable content, while a locator screenshot of a scrollable element includes only the portion currently visible within that container.
- A pytest failure image shows only the viewport: enable screenshot capture as well as
--full-page-screenshot. - An option is unavailable or behaves differently: compare the relevant API option with documentation for the Playwright version installed in your environment; the Page and Locator references linked above use a
/next/path.
Or skip the browser setup
For a one-request alternative, ScreenshotNeo returns a screenshot from a URL without requiring you to launch and configure a local Playwright browser. See the ScreenshotNeo API documentation for request options.
Recommended Free Tools
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. It also has an MCP server that lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo’s free plan.
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.




