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.

Use a real browser, not an HTTP client, to capture a rendered website with Python. Playwright is the most compact starting point: launch Chromium, open a page, call page.screenshot(), and close the browser. The same API can capture the viewport, the complete scrollable page, or one element, and can return image bytes instead of writing a file.

This guide gives you complete Playwright examples, explains the equivalent Selenium calls, covers output and timing options, and shows a no-browser-setup alternative with ScreenshotNeo.

What a Python website screenshot actually captures

A screenshot is an image of a page after a browser has rendered its HTML, CSS, fonts, images and JavaScript. A request made with requests or another HTTP client downloads source text; it does not produce the visual result a visitor sees. Browser automation is therefore required for client-rendered pages, responsive layouts and content that appears after scripts run.

Playwright’s Python API documents three useful scopes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
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
  • Viewport: the currently visible browser area (the default).
  • Full page: the complete scrollable document with full_page=True.
  • Element: one locator, such as a card or chart, with locator.screenshot().

Use a fixed viewport when you need repeatable dimensions. Otherwise, the browser’s default viewport determines the image size.

Playwright: the recommended focused example

Install Playwright and its browser binaries using the current instructions in the official Playwright Python documentation. Installation commands and browser requirements can vary by Playwright release and operating system, so check that page for your environment before running the code below.

Save a viewport screenshot

from playwright.sync_api import sync_playwright

url = "https://example.com"

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    context = browser.new_context(viewport={"width": 1440, "height": 900})
    page = context.new_page()
    page.goto(url, wait_until="load")
    page.screenshot(path="screenshot.png")
    browser.close()

page.goto() navigates the page, and page.screenshot(path=...) writes a PNG. The context viewport makes the capture predictable across machines. You can omit headless=True while debugging to watch the browser window.

Capture the entire scrollable page

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page(viewport={"width": 1440, "height": 900})
    page.goto("https://example.com", wait_until="networkidle")
    page.screenshot(path="full-page.png", full_page=True)
    browser.close()

full_page=True requests the full document rather than only the visible viewport. Pages that load content while scrolling may need an explicit scroll-and-wait routine before this call; see the timing section below.

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.

Capture one element

from playwright.sync_api import sync_playwright

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

The locator is resolved in the page and the image is clipped to that element’s bounds. Prefer stable selectors such as an ID, data attribute or semantic role over a fragile positional selector.

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

Return bytes instead of creating a file

from pathlib import Path
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", wait_until="load")
    image_bytes = page.screenshot(type="png")
    Path("screenshot.png").write_bytes(image_bytes)
    browser.close()

When path is omitted, Playwright returns the encoded image bytes. Send those bytes to object storage, an HTTP response or an image-processing library without an intermediate file.

Useful Playwright screenshot options

The Page API accepts options for image format, clipping, quality and rendering behavior. Check the API version you installed because defaults and available options can evolve.

Format, quality and scale

page.screenshot(
    path="preview.webp",
    type="webp",
    quality=82,
    scale="css"
)

PNG is lossless and has no quality setting. JPEG and WebP support quality where documented. scale="css" keeps output dimensions aligned with CSS pixels; the device scale setting can produce higher-density images.

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

Clip a rectangle

page.screenshot(
    path="region.png",
    clip={"x": 100, "y": 200, "width": 800, "height": 500}
)

Coordinates are page coordinates in CSS pixels. For an element, a locator screenshot is usually safer than manually maintaining coordinates.

Transparent backgrounds, animation and timeout

page.screenshot(
    path="transparent.png",
    omit_background=True,
    animations="disabled",
    timeout=30_000
)

Transparency is useful for pages whose background is transparent. Disabling animations reduces frame-to-frame differences. The timeout is in milliseconds; set it high enough for your slowest legitimate page, but keep a finite value so a failed navigation cannot hang a worker indefinitely.

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.

Waiting for the page you intend to capture

Navigation completion does not always mean that the visible content is ready. Choose a wait condition that matches the site.

Wait for a selector

page.goto("https://example.com/dashboard", wait_until="domcontentloaded")
page.locator("[data-testid='dashboard-ready']").wait_for(state="visible")
page.screenshot(path="dashboard.png")

Wait a deliberate delay

page.goto("https://example.com", wait_until="load")
page.wait_for_timeout(1500)
page.screenshot(path="delayed.png")

A fixed delay is simple but can be either wasteful or insufficient. Prefer a selector that represents readiness when one exists.

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

Handle lazy-loaded content

page.goto("https://example.com/article", wait_until="load")
page.evaluate("window.scrollTo(0, document.body.scrollHeight)")
page.wait_for_timeout(500)
page.screenshot(path="article-full.png", full_page=True)

Some sites load images only after they enter the viewport. Scrolling can trigger those requests; wait for a known image or content marker if possible.

Network idle is not universal

wait_until="networkidle" can help on a page that becomes quiet after its data requests finish, but analytics, advertisements and WebSockets may keep connections open. In those cases, wait for the specific content instead of waiting forever for network silence.

Async Playwright for concurrent jobs

Use the asynchronous API when your application already runs an asyncio event loop or captures several pages concurrently.

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
import asyncio
from playwright.async_api import async_playwright

async def capture():
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        page = await browser.new_page(viewport={"width": 1366, "height": 768})
        await page.goto("https://example.com", wait_until="load")
        await page.screenshot(path="async.png", full_page=True)
        await browser.close()

asyncio.run(capture())

Keep browser and context lifetimes explicit. Reusing one browser process for a batch while creating isolated contexts can reduce startup overhead and prevent cookies or local storage from leaking between jobs.

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

Selenium alternative

Selenium is a sensible choice when your project already uses its WebDriver workflow. The current Selenium Python API documents screenshots of the current window saved as PNG or returned in memory.

Save the current window

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--headless")
driver = webdriver.Chrome(options=options)
try:
    driver.get("https://example.com")
    driver.save_screenshot("selenium.png")
finally:
    driver.quit()

Get PNG bytes or base64

png_bytes = driver.get_screenshot_as_png()
base64_image = driver.get_screenshot_as_base64()

The cited Selenium API covers current-window capture and in-memory output. Do not assume that this reference provides Playwright’s documented, cross-route full_page=True behavior; full-page techniques can depend on browser and driver details.

Playwright or Selenium?

Question Playwright Selenium
Viewport capture Documented with page.screenshot() Documented for the current window
Full scrollable document Explicit full_page=True Not established by the cited current API reference
Single element locator.screenshot() Use existing WebDriver element workflows; exact behavior depends on the API and driver
Output File or bytes; PNG, JPEG and WebP options PNG file, PNG bytes or base64
Best fit New, focused screenshot scripts Projects that already depend on Selenium WebDriver

This is an API-scope comparison, not a speed or reliability ranking. Neither source establishes universal performance, compatibility or success-rate guarantees.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failures and fixes

The browser executable is missing

Symptom: launch fails before navigation. Fix: install the browser binaries required by your installed Playwright release using its current official installation instructions, then rerun the script in the same environment.

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

The image is blank or missing dynamic content

Cause: the screenshot ran before JavaScript or lazy loading finished. Fix: wait for a visible readiness selector, scroll to trigger lazy loading, or use a narrowly chosen delay. Inspect the page in headed mode.

Navigation times out

Cause: a slow origin, blocked request or page that never becomes idle. Fix: use a finite, appropriate navigation timeout; switch from network-idle waiting to a selector; and record the URL and exception for retry handling.

Cookie banners or chat widgets obscure the page

Cause: the browser sees the same overlays as a visitor. Fix: accept or dismiss the banner in your script, or hide a known selector before capture. Check that removing an overlay does not violate the site’s terms or consent requirements.

The full-page image is unexpectedly tall or incomplete

Cause: infinite scrolling, sticky elements, or content loaded only after scrolling. Fix: scroll in increments, wait for content, cap the intended capture area, and test the page’s layout at the chosen viewport.

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

Fonts or images differ between runs

Cause: external resources, responsive breakpoints, animation or device scale. Fix: set a fixed viewport and scale, disable animations, wait for the relevant resource or selector, and keep the runtime environment consistent.

Reliability, security and cost considerations

  • Resource cleanup: always close the browser in a finally block or context manager so failed jobs do not leave processes running.
  • Isolation: use a new context for unrelated sites; do not carry authentication cookies or headers into another tenant’s capture.
  • Secrets: keep credentials outside source code and pass only the headers or cookies required for the target.
  • Retries: retry transient navigation failures with a limit and backoff, but do not blindly retry a deterministic selector or authentication error.
  • Output size: full-page and high-density captures consume more memory. Prefer WebP or a controlled viewport when downstream systems do not need a huge lossless PNG.
  • Legal and privacy: capture only pages you are allowed to access, and treat screenshots as potentially containing personal or confidential data.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP or PDF. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the page verdict and billing result in X-Page-Verdict and X-Billed headers.

Python example (see the ScreenshotNeo documentation):

import requests

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

ScreenshotNeo also provides an MCP server for Claude, Cursor and other MCP clients, with take_screenshot, get_page_info and capture_pdf tools. Its free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up at ScreenshotNeo’s free account page.

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

FAQ

Can Python screenshot a page without opening a visible window?

Yes. Launch Playwright or Selenium in headless mode; the browser still renders the page, but no window is displayed.

Which format should I choose?

Use PNG for lossless archival or pixel comparison, JPEG for photographs where smaller files matter, and WebP when your consumers support it and you want a compact modern format.

Can I send a screenshot directly to an API?

Yes. Omit Playwright’s path to receive bytes, then upload those bytes or place them in your response. Selenium provides PNG bytes and base64 methods as well.

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.

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