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.

You can capture a rendered webpage in Python without Selenium using Playwright. It launches a browser, navigates to the URL, and saves either the visible viewport, the full scrollable page, or a specific element. This guide shows the synchronous and asynchronous approaches, explains which capture mode to choose, and covers common setup and rendering issues.

Use Playwright for a Python webpage screenshot

Playwright is the best-supported default for this task: its Python documentation covers browser launch, navigation, and screenshot capture directly. It can launch Chromium, Firefox, or WebKit; headless mode is the default. Playwright’s Python getting-started guide and screenshot guide document the workflow.

A browser is important when the image should reflect what a visitor sees after JavaScript and browser layout run. A regular HTTP fetch retrieves page content; it does not by itself produce a browser-rendered screenshot. Scrapy’s documentation explains this distinction and the role of a headless browser: Scrapy: Dynamic content.

Install the package and browser

Follow the current Playwright Python installation instructions for your operating system and install a browser binary for the engine you plan to use. The Python package alone is not the browser runtime. Installation details can change, so use the commands in the official guide rather than relying on an old copied command.

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.

Capture the visible viewport with synchronous Python

Save this as a Python file and replace the example URL with the page you want to capture. The synchronous API is convenient for a small script or a one-off task.

from playwright.sync_api import sync_playwright

url = "https://example.com"

with sync_playwright() as playwright:
    browser = playwright.chromium.launch()
    page = browser.new_page()
    page.goto(url)
    page.screenshot(path="screenshot.png")
    browser.close()

This writes a PNG of the page’s current viewport. The screenshot is taken after navigation reaches the point governed by Playwright’s navigation behavior; it does not guarantee that every delayed image, animation, or application-specific content has finished loading.

Use async Python when it fits your application

For an async application, use Playwright’s asynchronous API instead of blocking the event loop with the synchronous version. The browser lifecycle and capture are otherwise similar.

import asyncio
from playwright.async_api import async_playwright

async def main():
    url = "https://example.com"

    async with async_playwright() as playwright:
        browser = await playwright.chromium.launch()
        page = await browser.new_page()
        await page.goto(url)
        await page.screenshot(path="screenshot.png")
        await browser.close()

asyncio.run(main())

Use one style consistently: synchronous calls in the sync API and awaited calls in the async API. For a service that captures many pages, structure browser and page lifetimes around the service’s concurrency needs rather than launching a new browser for every URL without considering the cost.

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

Choose viewport, full-page, or element capture

Playwright’s screenshot API supports several scopes. Pick the smallest scope that answers your task; a full-page image can be much taller and harder to inspect than a viewport capture.

What to capture Python call Result
Visible viewport page.screenshot(path="screenshot.png") The currently visible browser area.
Full scrollable page page.screenshot(path="screenshot.png", full_page=True) A tall image representing the full page.
One element page.locator(".header").screenshot(path="header.png") An image cropped to the matching element.
Image bytes in memory image_bytes = page.screenshot() PNG bytes returned to Python instead of being written to a path.

Full-page captures and lazy content

Set full_page=True when you need the page beyond the initial viewport. Some sites load images or other content only as it approaches the viewport. A full-page screenshot option should not be mistaken for a guarantee that every site-specific lazy-loading mechanism has completed. If lower-page content is missing, inspect how the site loads it, scroll through the page before capture if appropriate, and wait for the relevant content to appear.

Capture a matching element

Use a locator when the target is a specific component, such as a header, chart, or product card. The selector must match an element that exists and is visible; otherwise the capture cannot produce the intended image. Prefer a stable selector, then verify the result if the page’s markup changes.

Keep the screenshot in memory

When another part of your program will upload or process the image, omit the path. The returned value is screenshot bytes, which you can pass to the relevant library or storage client:

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.
image_bytes = page.screenshot()
# Pass image_bytes to your image-processing or upload code.

Control the browser and screenshot result

Choose a browser engine

The Python library can launch Chromium, Firefox, and WebKit. The example uses Chromium; select another installed engine with the corresponding Playwright launcher when your project requires it. Browser-specific differences can affect rendering, so use the engine that matches the behavior you need to inspect.

Show the browser while debugging

Playwright runs headless by default. Set headless=False in the launch call when you need to see the browser UI during debugging:

browser = playwright.chromium.launch(headless=False)

This is a debugging choice, not a requirement for normal screenshot capture.

Other documented screenshot controls

The API reference documents additional controls, including animation handling, masking selected locators, and omitting the background for transparency. These are options to configure for a specific capture; do not assume they are enabled by default. See the Playwright page screenshot API reference for the current parameters.

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.
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

When Pyppeteer may make sense

Pyppeteer is a secondary option if your project specifically calls for a Puppeteer-style Python interface to headless Chrome or Chromium. Its project documentation describes it as an “Unofficial python port of puppeteer (headless) chrome/chromium browser automation library.” The cited reference is for Pyppeteer 0.0.25, so it does not establish current maintenance status or make Pyppeteer a better general choice than Playwright. Its documentation describes PNG and JPEG output, JPEG quality, full-page and clipped capture, and transparent backgrounds: Pyppeteer 0.0.25 reference.

For a new Python screenshot script without a requirement for a particular Puppeteer-style interface, start with Playwright’s current official Python documentation. Avoid treating a plain HTML download as an equivalent substitute when the result must reflect browser-rendered JavaScript, layout, or interaction.

Troubleshoot common screenshot problems

The browser will not launch

  • Likely cause: the Python package is installed but the selected browser binary is missing, or the environment cannot run it.
  • Fix: follow the current Playwright installation steps for the chosen browser and operating system. Check the error output for the engine it tried to launch and verify that the runtime is available in that environment.

The image is blank, incomplete, or shows a loading state

  • Likely cause: navigation completed before the page’s application-specific content was ready, or the site delayed content until later.
  • Fix: wait for a meaningful page element or for the site’s content to appear before taking the screenshot. For a page with lazy-loaded content, scroll through the relevant area and allow it to load. Do not assume one navigation wait condition suits every site.

The full-page image is missing lower-page images

  • Likely cause: images or sections load only when scrolled into view.
  • Fix: trigger the page’s normal scrolling behavior before capture, then verify the image. The exact handling depends on how the target page implements lazy loading.

The element screenshot fails or captures the wrong area

  • Likely cause: the selector does not match the intended element, or the element is not yet visible.
  • Fix: confirm the selector against the rendered page, wait for the target element to appear, and use a stable locator rather than a fragile positional selector.

The result differs from what a person sees

  • Likely cause: browser engine, viewport, site state, or timing differs from the human browsing session.
  • Fix: choose the intended browser engine and viewport, and wait for the page state that matters. If you need to inspect what the browser is doing, launch with headless=False.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

A local Playwright capture requires a Python environment and a browser runtime. The time and resource use depend on the target page, browser, and environment; no universal speed or reliability figure follows from the API documentation. Complex pages, external requests, and delayed content can make captures less predictable, so design your script to handle navigation and capture errors and to close the browser when work finishes.

If you capture many pages, decide whether to reuse browser processes and how much parallel work the host can support. Increasing concurrency can also increase CPU and memory use. Validate the approach against your own URLs and deployment environment rather than assuming results from one page apply to all sites.

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

Playwright is a software library; the cited documentation does not set a per-screenshot service price. Your practical costs come from running the code and browser in your own environment.

Or skip the browser setup

If you want a hosted screenshot instead of installing and operating a browser, ScreenshotNeo returns an image or PDF from one GET request. Its API accepts cookie-banner consent and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. It also provides an MCP server for AI agents, with take_screenshot, get_page_info, and capture_pdf tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

Python example (see the ScreenshotNeo API docs):

import requests

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

For the direct command-line equivalent:

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

ScreenshotNeo handles the browser setup, cleans common overlays before capture, and distinguishes billable clean screenshots from the failed or skipped cases listed above. To try it, sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Can Playwright save a screenshot without writing a file?

Yes. Call page.screenshot() without a path; it returns image bytes.

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

Does Playwright support Firefox and WebKit in Python?

Yes. The Python library can launch Chromium, Firefox, and WebKit, provided the chosen browser runtime is installed.

Is a normal HTTP request enough to screenshot a JavaScript-heavy page?

No. A raw HTTP fetch does not render the page as a browser does; use a browser runtime when rendered layout or JavaScript output matters.

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.