October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Redmond desk5 min

How to Take a Website Screenshot with Selenium on Windows

Use Selenium’s Python WebDriver to save the current browser window as a PNG at a Windows path, with guidance on element and full-page captures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Python’s Selenium WebDriver to open the site and call driver.save_screenshot() with a writable Windows file path. This saves a PNG of the current browser window—not automatically the entire scrollable page.

Take a Selenium screenshot and save it to a Windows folder

Install a current Selenium release for Python, then run this short example. In supported current Selenium releases, Selenium Manager handles driver setup; this example has not been verified on Windows.

As an Amazon Associate I earn from qualifying purchases.

from selenium import webdriver

# Selenium Manager handles driver setup in supported current Selenium releases.
driver = webdriver.Chrome()
try:
    driver.get("https://example.com")
    saved = driver.save_screenshot(r"C:UsersYourNamePictureswebsite.png")
    if not saved:
        raise OSError("Selenium could not save the screenshot")
finally:
    driver.quit()

Replace YourName with your Windows account folder and make sure Pictures exists and is writable. The r"..." raw string preserves backslashes in the path. Alternatively, escape them (for example, C:\Users\YourName\Pictures\website.png). Include a filename and the .png extension.

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

save_screenshot(path) saves the current window to a PNG. Selenium’s Python API also provides get_screenshot_as_file(path); use a full path and check its boolean result because file saving can fail on an I/O error. See the Python WebDriver API and Selenium window interaction documentation.

#1 Best Overall

Choose the capture scope you need

Capture Method What it captures Important detail
Current browser window driver.save_screenshot(path) or driver.get_screenshot_as_file(path) The current browser window’s visible page area Writes PNG to the supplied path; check the return value.
One element element.screenshot(path) The located WebElement Useful for a heading, chart, or component rather than the full viewport.
Full document Browser-specific full-page method The page beyond the current viewport, when supported The reviewed dedicated full-page methods are documented for Firefox. Verify support for your browser and installed Selenium version; do not assume the ordinary Chrome or Edge screenshot call captures the whole document.

Capture one element

Find the element after navigation, then save its screenshot. The destination folder must exist and be writable, just as for a window capture.

from selenium import webdriver
from selenium.webdriver.common.by import By

 driver = webdriver.Chrome()
try:
    driver.get("https://example.com")
    heading = driver.find_element(By.TAG_NAME, "h1")
    saved = heading.screenshot(r"C:UsersYourNamePicturesheading.png")
    if not saved:
        raise OSError("Selenium could not save the element screenshot")
finally:
    driver.quit()

Remove the leading space before driver = if copying this snippet—the line should align with try: as shown here:

driver = webdriver.Chrome()
try:
    driver.get("https://example.com")
    heading = driver.find_element(By.TAG_NAME, "h1")
    saved = heading.screenshot(r"C:UsersYourNamePicturesheading.png")
    if not saved:
        raise OSError("Selenium could not save the element screenshot")
finally:
    driver.quit()

Set a repeatable viewport

If image dimensions matter, set the browser window size before navigation or capture. Window-size and rectangle controls define the viewport, but they do not guarantee identical rendering on different machines.

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 #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.
driver.set_window_size(1280, 900)
driver.get("https://example.com")
driver.save_screenshot(r"C:UsersYourNamePictureswebsite.png")

For full-document capture, Selenium’s reviewed Firefox API exposes save_full_page_screenshot and get_full_page_screenshot_as_file. Check the installed Selenium API and chosen browser before relying on either. The standard current-window method is not a cross-browser full-page recipe. See the Firefox WebDriver API.

Wait for the page state you need

A screenshot taken immediately after navigation may miss content that a site loads asynchronously. Selenium’s page-load behavior does not establish one wait that works for every site. Wait for the specific element or condition your page requires, then capture; for example, use an explicit wait for the heading you intend to screenshot.

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

WebDriverWait(driver, 10).until(
    EC.visibility_of_element_located((By.TAG_NAME, "h1"))
)
driver.save_screenshot(r"C:UsersYourNamePictureswebsite.png")

Choose a timeout appropriate to your workflow and site; a timeout is not proof that a page can never load. Selenium’s navigation and interaction guidance is available in its WebDriver documentation.

Rank #3
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot missing or failed screenshots

  • No file appears: Confirm the parent directory exists, the process has write permission, and the path includes a filename and .png. Use a raw string or escape backslashes.
  • The method reports failure: Check the boolean returned by the file-saving method. A false result indicates an I/O problem in the documented API; verify the path and permissions.
  • The screenshot shows only part of the page: The ordinary WebDriver screenshot captures the current browser window. Use a Firefox-supported full-page API only after checking your browser and Selenium version, or capture individual elements when that is the actual need.
  • Content is missing: Capture after navigation and after the specific asynchronous content is ready. Wait for the relevant element or condition instead of assuming one universal delay.
  • The browser remains open after an error: Keep driver.quit() in a finally block so the session is closed whether capture succeeds or raises an exception.

Or skip the browser setup

ScreenshotNeo takes a website screenshot through one GET request, returning PNG, JPEG, WebP, or PDF. For example, save a WebP capture with cURL:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo documentation for the API and its options. It accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of these steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month without a card.

Frequently Asked Questions

How do I save a Selenium screenshot to a Windows folder?

Pass a full writable Windows path ending in .png to driver.save_screenshot(); use a raw Python string for backslashes.

How do I take a full-page screenshot in Selenium?

The ordinary current-window method is not a full-document capture. The reviewed dedicated full-page methods are documented for Firefox, so verify browser and Selenium-version support before using them.

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

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$245.99
Bestseller No. 2
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$285.00

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.