October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Bulk Website Screenshots with Selenium and Python

Use one Selenium WebDriver session to visit a URL list and save a checked, uniquely named PNG for each page.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To capture many websites with Selenium, loop through a list of URLs, open each in one WebDriver session, and save the current browser window to a uniquely named PNG. Check the return value of save_screenshot() for every file, then close the browser with quit(). The example below uses Selenium’s documented Python API method, which captures the current window rather than promising a full-page image.

What this script does—and what it captures

Selenium’s Python save_screenshot(filename) method writes a PNG of the current browser window and returns True when the save succeeds or False if an I/O error occurs. Selenium recommends providing a full path and a .png extension. See the Selenium Python WebDriver API.

This is a window screenshot, not a universal full-page capture. It shows the portion rendered in the browser window at the time of capture. If you need full-page images, verify a browser-specific technique against that browser’s current documentation instead of assuming this method captures beyond the viewport.

Install Selenium and prepare the URL list

Install Selenium in the Python environment that will run the script:

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.
python -m pip install selenium

Put the pages to capture in a Python list. The sample below uses Selenium’s Chrome WebDriver. Selenium’s documented example follows the same basic sequence: create a driver, navigate, save, and quit. Browser and driver setup may vary by machine; consult Selenium’s current WebDriver documentation if the browser does not start.

Run a bulk screenshot script

Save this as bulk_screenshots.py. It creates the output directory, gives each URL a numbered PNG filename to prevent collisions, fixes the browser window size for more consistent comparisons, reports failed saves, and quits the browser even if a capture raises an exception.

from pathlib import Path
from selenium import webdriver

URLS = [
    "https://example.com/",
    "https://www.python.org/",
    "https://www.selenium.dev/",
]

OUTPUT_DIR = Path("screenshots")
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)

options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options)

try:
    # Use the same viewport for each page when comparing screenshots.
    driver.set_window_size(1440, 1000)

    for index, url in enumerate(URLS, start=1):
        filename = OUTPUT_DIR / f"{index:03d}.png"
        print(f"Capturing {url} -> {filename}")

        try:
            driver.get(url)
            saved = driver.save_screenshot(str(filename))
            if saved:
                print(f"Saved {filename}")
            else:
                print(f"Save failed for {url}: Selenium reported an I/O error")
        except Exception as exc:
            print(f"Capture failed for {url}: {exc}")
finally:
    driver.quit()

Run it from a terminal with:

python bulk_screenshots.py

Successful captures appear in the screenshots directory as 001.png, 002.png, and so on, in the order of the URL list. The numbering is deliberately stable and unique within this run; rerunning the script overwrites files with the same numbers.

Make the batch useful and predictable

Keep viewport dimensions fixed for comparisons

Screen resolution can affect how a page renders. Set a consistent window size before the loop when visual comparisons matter; Selenium documents window sizing in its windows and tabs guide. The screenshot remains a capture of the current browser window, so choose dimensions that show the area you need.

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.

Handle filenames and reruns deliberately

Sequence-based names avoid unsafe characters and duplicate URL-derived names. If you need filenames tied to pages, generate a sanitized slug and still include a sequence number or other uniqueness component. Decide whether a new run should overwrite prior output or write into a timestamped folder.

Choose a loading policy that matches the pages

The sample navigates to each URL and captures after driver.get() returns. Pages that render important content later may need a wait condition before saving; a fixed delay is simple but can be wasteful or insufficient across sites. The right condition depends on the page. Selenium’s documentation does not establish a universal delay or batch size for reliable captures.

Know what affects run time

There is no documented throughput figure to rely on here. Total elapsed time depends on the sites, their load behavior, browser configuration, and the machine running the batch. One browser session is straightforward to manage; adding concurrent sessions introduces more browser and resource management and should be tested against the target workload rather than assumed to be faster or more reliable.

Troubleshooting common failures

  • Chrome does not start: Check that Chrome is installed and that the environment can launch it. Review Selenium’s current WebDriver setup guidance for browser and driver compatibility.
  • A PNG is missing or the save reports False: Confirm the output directory exists and the process can write to it. The script creates the directory, but filesystem permissions can still prevent saving.
  • Two pages overwrite one image: Use unique output filenames. The numbered scheme above assigns a distinct name to every list entry.
  • The capture shows only part of the page: save_screenshot() captures the current window. Increase the window dimensions if that helps, or use a browser-specific full-page approach verified for the browser you run.
  • The screenshot shows incomplete content: The page may still be rendering after navigation. Add a wait appropriate to the content that must appear before capture.
  • One URL fails and stops the batch: Keep per-URL exception handling inside the loop, as in the sample, so later URLs can still be attempted. Inspect the printed error and decide whether to retry or record that URL for a later run.
  • The process leaves browser processes open: Ensure driver.quit() runs in a finally block so the WebDriver session is closed after success or an error.
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 offers a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF; its cleanup options can accept consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture. The service says bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with page verdict and billing headers in responses. An MCP server exposes screenshot tools to AI agents, and the free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000.

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

For example, this cURL request saves a WebP screenshot of one URL; repeat it for each address in your batch or use the API’s bulk capture option for up to 100 URLs per call. See the ScreenshotNeo API documentation for request options.

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 1,000 free screenshots a month with no card.

Frequently asked questions

Can I save screenshots as JPEG instead of PNG with Selenium?

The documented save_screenshot() method saves PNG files. Converting the saved image to another format is a separate step.

Does Selenium WebDriver support only one browser protocol?

Selenium describes WebDriver as a W3C Recommendation and WebDriver BiDi as a bidirectional automation protocol developed with browser vendors. Details are in its WebDriver overview.

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

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.