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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk7 min

How to Bulk Screenshot Web Pages with Selenium Grid

Selenium Grid distributes remote browser sessions, while your client code manages URL batches, waits, screenshots, filenames, retries and storage.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Selenium Grid can run screenshot jobs in parallel by distributing remote browser sessions across available machines. It does not take a URL list and create an image archive by itself: your client application must build the batch, assign URLs to a bounded number of RemoteWebDriver sessions, wait for each page, capture and save the returned image, and record failures.

What Selenium Grid does—and what your batch code must do

Grid routes WebDriver commands to remote browser instances. Its core use includes parallel execution across machines, browser versions, and platforms, so it can provide browser capacity for a screenshot pipeline. The client still owns the URL worklist, scheduling limits, retries, filenames, artifact storage, and per-URL outcome records. Those batch responsibilities follow from the documented client/server model; they are not a built-in Grid screenshot archive feature. See Selenium’s Grid overview and Remote WebDriver documentation.

As an Amazon Associate I earn from qualifying purchases.

A useful unit of work is one URL plus one capture configuration—for example, a page at a specific viewport and browser. A worker creates a remote session, visits its assigned page, waits for the state your project needs, captures the image, saves it with a deterministic name, records metadata, and closes the session. Grid places sessions on its available nodes; the client decides how many jobs to submit concurrently.

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.

Set up a Grid endpoint

For a local or CI setup, Selenium’s getting-started guide describes a Standalone server listening on port 4444. The documented setup path calls for Java 11 or higher, a browser, a driver (or Selenium Manager), and the Selenium Server JAR. Standalone runs on one machine. Hub-and-Node and Distributed arrangements support deployments with multiple machines or more involved capacity needs; choose based on the browsers and operating systems required, parallel sessions, available machines, and machine power. Follow the current Selenium Grid getting-started guide for the server command appropriate to your installation.

#1 Best Overall

Keep the Grid endpoint inside its intended trust boundary. Selenium warns that an externally reachable Grid can expose internal applications or files and allow third parties to run custom binaries; use private networking and firewall protection, with access controls appropriate to your environment.

Build a bounded screenshot batch in Python

The example below uses a Python thread pool to limit concurrent sessions. It assumes a reachable Grid endpoint, Selenium installed in the Python environment, and a directory where the client can write image and JSON files. Set GRID_URL to your Grid endpoint and replace the example URLs with your worklist. The wait condition is intentionally a document-ready check; applications that render content asynchronously should use an application-specific readiness condition instead.

import json
import re
import threading
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import datetime, timezone
from pathlib import Path
from urllib.parse import urlparse

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait

GRID_URL = "http://localhost:4444"
OUT = Path("screenshots")
WORKERS = 4
VIEWPORT = {"width": 1440, "height": 1000}
URLS = [
    "https://example.com/",
    "https://www.selenium.dev/documentation/grid/",
]

OUT.mkdir(parents=True, exist_ok=True)
write_lock = threading.Lock()

def safe_name(url):
    parsed = urlparse(url)
    base = (parsed.netloc + parsed.path).strip("/") or "page"
    return re.sub(r"[^A-Za-z0-9._-]+", "_", base)[:160]

def capture(item):
    index, url = item
    driver = None
    stem = f"{index:04d}_{safe_name(url)}_chrome_{VIEWPORT['width']}x{VIEWPORT['height']}"
    record = {
        "url": url,
        "captured_at": datetime.now(timezone.utc).isoformat(),
        "browser": "chrome",
        "viewport": VIEWPORT,
    }
    try:
        options = Options()
        options.add_argument(f"--window-size={VIEWPORT['width']},{VIEWPORT['height']}")
        driver = webdriver.Remote(command_executor=GRID_URL, options=options)
        driver.set_window_size(VIEWPORT["width"], VIEWPORT["height"])
        driver.get(url)
        WebDriverWait(driver, 30).until(
            lambda d: d.execute_script("return document.readyState") == "complete"
        )
        image_path = OUT / f"{stem}.png"
        if not driver.save_screenshot(str(image_path)):
            raise RuntimeError("WebDriver reported that the screenshot was not saved")
        record.update({"status": "ok", "image": str(image_path),
                       "capabilities": driver.capabilities})
    except Exception as exc:
        record.update({"status": "error", "error": f"{type(exc).__name__}: {exc}"})
    finally:
        if driver is not None:
            try:
                driver.quit()
            except Exception as exc:
                record["session_close_error"] = f"{type(exc).__name__}: {exc}"
    with write_lock:
        (OUT / f"{stem}.json").write_text(json.dumps(record, indent=2), encoding="utf-8")
    return record

with ThreadPoolExecutor(max_workers=WORKERS) as pool:
    futures = [pool.submit(capture, item) for item in enumerate(URLS, start=1)]
    for future in as_completed(futures):
        result = future.result()
        print(result["status"], result["url"], result.get("image", result.get("error")))

Install the client dependency with python -m pip install selenium. The code creates a fresh session for each URL, making each capture independent; it also bounds simultaneous sessions with WORKERS and attempts to quit every successfully created session even after navigation or capture errors. The JSON sidecar records the source URL, timestamp, viewport, browser capabilities and outcome. Treat capability data as metadata, not as a guarantee that every browser reports identical fields.

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.

Adapt the readiness and capture policy

  • Wait for application content when needed. document.readyState == "complete" does not ensure that client-side rendering, lazy images, animations, or API-fed content are finished. Wait for a stable selector or other project-specific condition if those elements matter. Selenium’s interaction examples demonstrate screenshot calls, but do not prescribe one universal readiness wait: Working with windows and tabs.
  • Keep visual comparisons consistent. Set the same viewport and browser configuration for comparable captures, and record them with the artifact. Selenium notes that screen resolution can affect rendering.
  • Check screenshot scope. A screenshot call does not necessarily mean a full-page capture. The JavaScript WebDriver API describes takeScreenshot() as best-effort, with an order of entire page, current window, visible portion of the current frame, then browser display. That API wording is not a cross-browser guarantee. Confirm actual output for your chosen browser and Grid configuration: JavaScript WebDriver API.

Choose concurrency based on measured capacity

More workers can increase throughput only while the Grid, its nodes, browser startup, target sites, and artifact storage can sustain the load. Selenium’s getting-started guide offers a rough reference of about one CPU and around 1 GB of RAM per browser session, while explicitly cautioning that these are recommendations, not rules. It also notes that default Node concurrency is CPU-limited and Safari is limited to one session. Measure your own environment rather than treating those figures as a sizing guarantee.

Selenium’s “When to Use Grid” page illustrates the relationship as “Number of Tests * Average Test Time / Number of Nodes = Total Execution Time.” Its examples are explanatory arithmetic, not measured throughput promises. For a screenshot batch, also account for browser startup, queueing, page readiness time, transfer of image bytes, and output writes. Start with a conservative worker limit, observe node utilization and failures, then adjust.

Save remote screenshots and handle downloads separately

With the WebDriver screenshot API, the remote browser returns screenshot data through the client call; the example saves it from the client process. Use stable identifiers and include a browser/viewport variant in filenames so repeated URLs or different capture configurations do not overwrite one another. Keep a sidecar record or database entry with URL, capture time, configuration, and outcome.

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.

Browser downloads are a different problem from screenshot output. Selenium documents managed downloads for Grid: enable managed downloads on the Grid and opt in from the client. The remote guide notes that the listed files are an immediate snapshot and Selenium does not wait for downloads to finish. Do not assume a downloaded file is available just because a screenshot command returned.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure modes and fixes

Symptom Likely cause What to check
Session creation fails or times out The endpoint is wrong or unreachable, the requested browser is unavailable, or node capacity is exhausted. Verify the Grid URL and network path, inspect Grid/node status, confirm the browser capability is supported, and reduce the worker count.
Screenshot is blank or misses page content The page has not reached the required application state, or content is rendered asynchronously. Wait for a page-specific selector or condition; inspect whether the page actually loaded in the remote browser before capture.
Image shows only a viewport, not the full page Screenshot scope varies by API, browser and driver; full-page behavior is best effort. Confirm the output for the exact browser and Grid configuration. Do not infer full-page support from a successful screenshot call.
Multiple captures overwrite one file Names are based only on a non-unique URL or omit a browser/viewport variant. Include a stable work-item ID and relevant capture configuration in each artifact name.
Some pages fail while the batch continues A navigation, wait, browser or target-site error occurred for an individual job. Record a per-URL error, make retry policy explicit, and retry only failures your workflow classifies as transient. Ensure each session is quit in a finally path.
Grid slows down as workers increase Node CPU/RAM, browser startup, target site limits, or image storage/transfer may be the bottleneck. Reduce concurrency, measure where time and resources are spent, and scale or tune the limiting component rather than increasing workers blindly.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request can return a PNG, JPEG, WebP, or PDF; the service accepts a cookie/consent banner like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture, with each step switchable. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

For example, with an API key:

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 API documentation for parameters and response details. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.

Frequently asked questions

Can Grid capture multiple URLs from a file on its own?

No. Your client program must read the URL list and create the WebDriver jobs; Grid routes the resulting sessions and commands.

Can I use the same approach for multiple browser variants?

Yes. Treat each URL/browser/viewport combination as its own work item, set the desired browser options for that session, and include the variant in the artifact name and metadata.

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 *

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.

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
PC Slower Than It Used to Be?Free scan - under a minute

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.