DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober 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 Scan×
Skip to content
World desk6 min

Best Way to Capture Website Screenshots in Bulk with Selenium

A practical Selenium workflow for batch website screenshots, with runnable Python, readiness checks, unique filenames, troubleshooting, and capture-mode caveats.

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.

For a dependable batch, run a controlled WebDriver loop: set a consistent viewport, visit each URL, wait for the page content you need, save a uniquely named PNG, record the result, and always close the browser session. Selenium’s standard Python screenshot method captures the current window, not automatically the full document; choose and verify the capture mode before processing a large list.

Choose the screenshot extent before starting

“Screenshot” can mean three different outputs. Decide which one the batch needs before writing its loop:

As an Amazon Associate I earn from qualifying purchases.

  • Current window: captures the browser’s visible window. Selenium’s Python save_screenshot() saves this view as a PNG. The official API documents this for Chromium and remote WebDriver. Selenium Python WebDriver API
  • Single element: captures an element rather than the whole page; Selenium’s guide includes element screenshot examples. Selenium WebDriver guide
  • Full document: captures beyond the visible viewport. The reviewed Firefox Python API documents full-document screenshot methods such as save_full_page_screenshot(). Do not assume that this method or equivalent behavior is available in every browser driver; check the official API for the specific browser and version you deploy. Selenium Firefox WebDriver API

The example below produces current-window PNGs. If you need element or full-document images, substitute a supported method for the driver you use rather than treating a larger viewport as guaranteed full-page capture.

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

Build a reliable sequential batch

One browser session processing URLs in sequence is a straightforward starting point. Keep the input list stable, assign an output name that cannot collide when URLs repeat, record each outcome, and quit the driver even when navigation or saving fails.

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

urls = [
    "https://example.com",
    "https://example.org",
]
out = Path("screenshots")
out.mkdir(parents=True, exist_ok=True)

# ChromeOptions can be configured for headless operation if needed.
options = webdriver.ChromeOptions()
# Uncomment to run without a visible browser window:
# options.add_argument("--headless")

driver = webdriver.Chrome(options=options)
manifest = []
try:
    driver.set_window_size(1440, 1000)
    for index, url in enumerate(urls, start=1):
        filename = f"page-{index:04d}.png"
        path = out / filename
        try:
            driver.get(url)
            # Replace this example with a selector meaningful for your pages.
            WebDriverWait(driver, 20).until(
                EC.presence_of_element_located((By.TAG_NAME, "body"))
            )
            saved = driver.save_screenshot(str(path))
            status = "saved" if saved else "write_failed"
            manifest.append({"url": url, "status": status, "path": str(path)})
        except Exception as exc:
            manifest.append({
                "url": url,
                "status": "error",
                "path": str(path),
                "error": str(exc),
            })
finally:
    driver.quit()

for row in manifest:
    print(row)

This example uses one session and one fixed viewport; it is a workflow pattern, not a performance test or guarantee. Selenium’s guide documents a Chrome headless options example, but rendering should be checked in the browser and deployment environment you intend to use. Selenium WebDriver guide

Install and run

Install Selenium in the Python environment used for the job, then run the script with a compatible browser and WebDriver setup. Selenium’s official project documentation describes the project and its supported WebDriver approach: What is Selenium? The exact browser and driver installation steps depend on your operating system and deployment; follow the current documentation for that environment.

Wait for the content that belongs in the image

A navigation call returning does not prove that asynchronous content, images, or client-rendered sections have settled. Prefer an explicit condition tied to the page, such as a key element appearing or a loading indicator disappearing. Use a fixed delay only when the site offers no useful readiness signal, and set a limit so one slow page cannot block the whole batch indefinitely. Lazy-loaded images, animations, cookie dialogs, and infinite scrolling require page-specific handling; the screenshot API alone does not ensure they are in the desired state.

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.

Name and record outputs

The index in the example makes filenames unique even if the URL list contains duplicates. For reruns or longer-lived archives, use a stable identifier derived from the source data as well, while ensuring sanitized names cannot overwrite one another. Keep a manifest with at least the original URL, status, output path, and error detail. This makes it possible to retry only failures and distinguish a navigation problem from a file-write problem.

Run the batch at a controlled scale

Sequential or concurrent sessions

Sequential capture is easier to debug and limits resource use to one active browser session. Multiple isolated sessions can increase throughput, but their useful concurrency depends on page complexity, browser build, machine resources, and any Selenium Grid setup. The official APIs cited here do not establish a universal worker count or screenshots-per-minute figure. Start with one session, measure the actual workload, and increase concurrency gradually while monitoring memory, CPU, failures, and timeouts.

Keep browser and output ownership clear

For local execution, the example writes files to the machine running Python. With remote WebDriver or a Grid, make explicit where the browser runs and how screenshot data reaches the process that stores or uploads it. Selenium exposes file and in-memory screenshot forms, including bytes and base64 in its Python API; use the form that fits the deployment rather than assuming a remote node’s filesystem is the local output directory. Selenium Python WebDriver API

Check save results and clean up

The Python API says the screenshot filename should end in .png and that save_screenshot() returns False on an IOError. Check that boolean, as the example does, and retain the URL and path in the log. Put driver.quit() in a finally block so the browser session is closed after both successful and failed runs. Selenium Python WebDriver API

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

Troubleshoot common batch failures

Symptom Likely cause What to do
Screenshot contains a loading state or missing content The page had not reached the state required for capture; navigation completion is not a universal signal that asynchronous content has settled. Wait for a page-specific element or for a known loading indicator to disappear. Increase a bounded timeout only when the site’s normal behavior warrants it.
Screenshot is cut off below the visible area The code captured the current window rather than the full document. Use a full-document method documented for the selected driver, or capture the relevant element. The reviewed Firefox API documents full-document methods; verify support for other drivers in their current official documentation.
Some output files are missing A write failed, the path was invalid, or a batch exception interrupted processing. Use an existing writable output directory, use a filename ending in .png, check the method’s boolean result, and log per-URL exceptions so later URLs can still be attempted.
Files overwrite each other The naming scheme is not unique, often because URLs repeat or sanitize to the same name. Add a stable sequence number or unique record ID and retain the original URL in a manifest.
The batch stops after one problematic page An uncaught navigation, wait, or capture exception escaped the loop. Catch errors per URL, record the failure context, continue if that matches the job’s policy, and keep session shutdown in finally.
Headless output differs from desktop output The rendering environment or configuration differs, including viewport and fonts. Set the viewport explicitly and compare representative pages in the intended browser and deployment environment before relying on the output.
Remote screenshots are not found at the local path The browser session may be running on a remote node, so its filesystem is not necessarily the Python process’s filesystem. Use an in-memory screenshot form or an explicitly configured transfer/storage path appropriate to the remote setup.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents use screenshot tools, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000.

For API details and parameters, see the ScreenshotNeo documentation. This cURL example saves a WebP screenshot:

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

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Does Selenium’s Python `save_screenshot()` capture the full page?

No. Its documented output is a PNG of the current window. Full-document capture requires a supported method for the selected browser driver.

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

Can I use Selenium screenshots in memory instead of writing PNG files?

Yes. Selenium’s Python WebDriver API documents in-memory screenshot forms, including bytes and base64; choose one that fits your storage or transfer flow.

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 *

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.