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 desk9 min

How to Create Website Thumbnails from a List of URLs

A practical Playwright workflow for turning a URL list into saved website thumbnails, with naming, failure handling, output choices, and a hosted API alternative.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a browser automation script to read the URLs, open each page, and save a screenshot under a unique filename. Playwright provides the navigation and screenshot operations; your script supplies the batch loop, filename rules, failure handling, and concurrency. For compact preview cards, capture a consistent viewport and resize or crop the images afterward. Use full-page captures when you need the entire scrollable page rather than a thumbnail-sized view.

What you need to build

Playwright’s documented screenshot workflow is to navigate a browser page to a URL, capture it, and save the result. Its Page API also supports full-page screenshots, returning image bytes for further processing, and capturing a specific element. A list workflow is your own loop around those operations—not a built-in batch command.

As an Amazon Associate I earn from qualifying purchases.

The key implementation decisions are how to validate the input, name files, handle failures, limit concurrency, and standardize image dimensions. The examples below use Python with Playwright’s asynchronous API. Install Playwright and its browser runtime in the environment that will run the job:

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 playwright
python -m playwright install chromium

Save the following as thumbnails.py. It reads one URL per line from urls.txt, stores images in thumbnails/, and writes a JSON manifest that maps each input URL to its output path and status.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Create thumbnails from a URL list with Playwright

1. Prepare the URL list

Put one URL on each line in urls.txt. Blank lines and lines beginning with # are ignored. Include the scheme, such as https://, rather than guessing whether an address should use HTTP or HTTPS.

https://example.com/
https://www.python.org/
https://playwright.dev/

2. Run a batch script with unique filenames and per-URL status

import asyncio
import hashlib
import json
from pathlib import Path
from urllib.parse import urlsplit

from playwright.async_api import async_playwright

INPUT_FILE = Path("urls.txt")
OUTPUT_DIR = Path("thumbnails")
MANIFEST_FILE = OUTPUT_DIR / "manifest.json"
NAVIGATION_TIMEOUT_MS = 30_000
MAX_CONCURRENCY = 3
VIEWPORT = {"width": 1280, "height": 720}


def read_urls(path: Path) -> list[str]:
    urls = []
    for raw in path.read_text(encoding="utf-8").splitlines():
        value = raw.strip()
        if not value or value.startswith("#"):
            continue
        parts = urlsplit(value)
        if parts.scheme not in {"http", "https"} or not parts.netloc:
            raise ValueError(f"Expected an absolute HTTP(S) URL: {value}")
        urls.append(value)
    return urls


def output_name(url: str, index: int) -> str:
    parts = urlsplit(url)
    host = (parts.hostname or "site").replace(".", "_")
    # The index distinguishes repeated input rows; the digest avoids collisions
    # between different paths or query strings on the same host.
    digest = hashlib.sha256(url.encode("utf-8")).hexdigest()[:12]
    return f"{index:04d}_{host}_{digest}.png"


async def main() -> None:
    urls = read_urls(INPUT_FILE)
    OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
    semaphore = asyncio.Semaphore(MAX_CONCURRENCY)
    results = [None] * len(urls)

    async with async_playwright() as playwright:
        browser = await playwright.chromium.launch()

        async def capture(index: int, url: str) -> None:
            filename = output_name(url, index + 1)
            output_path = OUTPUT_DIR / filename
            result = {"input_url": url, "file": str(output_path), "status": "failed"}
            async with semaphore:
                page = await browser.new_page(viewport=VIEWPORT)
                try:
                    response = await page.goto(
                        url,
                        wait_until="load",
                        timeout=NAVIGATION_TIMEOUT_MS,
                    )
                    await page.screenshot(
                        path=str(output_path),
                        full_page=False,
                        type="png",
                        timeout=NAVIGATION_TIMEOUT_MS,
                    )
                    result["status"] = "ok"
                    result["http_status"] = response.status if response else None
                except Exception as exc:
                    result["error"] = f"{type(exc).__name__}: {exc}"
                finally:
                    await page.close()
            results[index] = result
            print(f"{result['status']}: {url}")

        try:
            await asyncio.gather(*(capture(i, url) for i, url in enumerate(urls)))
        finally:
            await browser.close()

    MANIFEST_FILE.write_text(
        json.dumps(results, indent=2, ensure_ascii=False), encoding="utf-8"
    )
    failures = sum(item["status"] != "ok" for item in results)
    print(f"Saved {len(results) - failures} of {len(results)} thumbnails; manifest: {MANIFEST_FILE}")


if __name__ == "__main__":
    asyncio.run(main())

Run it from the directory containing urls.txt:

python thumbnails.py

The script reuses one browser and creates a separate page for each URL, with at most three pages capturing at once. That concurrency value is a starting choice in this example, not a Playwright limit or a universally safe batch size. Reduce it if pages are heavy, the machine is resource-constrained, or target sites start failing; increase it only after checking resource use and the sites’ behavior.

3. Choose a stable naming and manifest strategy

A filename based only on a hostname can overwrite captures from different paths on the same site. The example combines the input row number, hostname, and a short digest of the entire URL to distinguish those cases. The manifest preserves the original URL, resulting file, status, and—when navigation returned one—the HTTP status. Keep the manifest even if you later move the images into another storage system; it is the practical link between input rows and outputs.

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

Choose viewport, full-page, or element captures

Viewport captures for preview cards

The example captures the initial viewport at 1280 × 720 CSS pixels. A fixed viewport makes the composition more consistent, although pages can still differ in layout, loading behavior, and content. A viewport screenshot is usually the more useful starting point for a thumbnail grid because it avoids extremely tall images.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Full-page captures for audits or archives

Set full_page=True in the screenshot call to capture the full scrollable page. Playwright describes this as capturing the page “as if it were a very tall screen.” Full-page images may be too tall for compact cards and can require more memory and disk space.

Full-page capture is not a substitute for verifying that content loaded correctly. Lazy-loaded images or sections that appear only after scrolling may require additional interaction or scrolling logic. If you need those assets, test representative pages and add a deliberate load strategy rather than assuming navigation alone triggers every page behavior.

Capture a single element

When the desired thumbnail is a particular card, product image, or other component, locate that element and capture it instead of the entire page:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
element = page.locator("main .product-card").first
await element.screenshot(path="product-card.png", type="png")

Replace the selector with one that is meaningful on the target site. Selectors vary by site, so element capture is best suited to a known page design or a set of pages that share a layout.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Standardize image format and dimensions

Format, quality, and scale

Playwright screenshot options let you select an image type, quality for supported lossy formats, and scale. For example, JPEG output can use a quality setting; PNG is lossless and does not use that quality control. WebP may be used where supported by the installed Playwright and browser version. Check the current Page API for the exact option behavior for your installed version: Playwright Page API.

Screenshot scale affects output pixels. CSS scale produces one output pixel per CSS pixel, which can keep high-DPI captures smaller; device scale captures device pixels and may produce a larger image. If every thumbnail must fit a fixed canvas, resize or crop after capture with an image-processing step. Pick the target aspect ratio and whether cropping is acceptable before choosing that step, since cropping can remove page content.

Preserve the capture bytes for processing

Instead of writing directly to a path, request screenshot bytes and pass them to an image-processing library or storage client:

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.
image_bytes = await page.screenshot(type="png", full_page=False)
# Pass image_bytes to your resize, crop, or upload step.

Make the batch safer and more reliable

Validate URLs and protect the capture environment

The sample accepts only absolute HTTP and HTTPS URLs. If URLs come from untrusted users, scheme validation is not enough: a worker that can access internal services might be induced to request private or administrative endpoints. Run captures in an appropriately isolated environment and restrict outbound network access to the destinations your workflow intends to allow. This is general security practice for URL-fetching systems, not a Playwright guarantee.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Keep failures independent

The example catches errors for each page, records the failure, and continues the rest of the batch. The manifest makes partial success visible rather than leaving you with a directory of images and no reliable indication of missing captures. A non-2xx HTTP response can still render a page; the script records the returned status but treats navigation and screenshot completion separately.

Use timeouts and selective retries

The example uses a 30-second navigation timeout and a screenshot timeout. These values are configuration choices, not universal recommendations. Slow sites, long-running applications, and network conditions can require different limits. If retrying, retry only transient failures and cap attempts; repeating a request cannot fix an invalid URL, a persistent access block, or a selector that does not exist. Record each final outcome so retries do not silently hide unreliable targets.

Choose a wait condition deliberately

The example waits for the page’s load event. Some sites continue rendering after that point; others keep network connections open, making a network-idle wait unsuitable. For pages with known dynamic content, wait for a selector that marks the content you need, or use a measured delay where necessary. The right condition depends on the site and what the thumbnail must show; test it on representative URLs.

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

Troubleshooting common batch failures

  • Invalid URL error: The input is missing a scheme, has no hostname, or is not HTTP(S). Supply a complete URL and confirm that the intended scheme is clear instead of silently guessing.
  • Browser executable is missing: Install the browser runtime for the Playwright package in the same environment that runs the script with python -m playwright install chromium.
  • Navigation timeout: The site may be slow, unreachable, or waiting on behavior that does not match the selected wait condition. Check the address, adjust the timeout for your workload, or wait for a specific content selector. Avoid increasing concurrency as a fix for slow navigation.
  • Screenshot fails after navigation: The page may be unusually large, the renderer may be under resource pressure, or the page may have closed. Try a viewport capture, lower concurrency, or capture a specific element.
  • Thumbnail looks blank or incomplete: Confirm that the page rendered the expected content before capture. For dynamic pages, wait for the relevant selector or use a suitable delay; for lazy content, add scrolling or other page-specific behavior before full-page capture.
  • Images are overwritten: Use filenames that incorporate more than the hostname. A row identifier plus a digest, as in the example, avoids collisions for repeated hosts and distinct URL paths.
  • The output files are too large or oddly shaped: Choose CSS or device scale intentionally, select an image format appropriate to the consumer, and resize or crop to a defined canvas when uniform dimensions are required.

When to use a local script or a hosted screenshot API

A local Playwright script is a good fit when you need control over browser behavior and can maintain the runtime and browser installation. A hosted API can reduce the browser infrastructure you operate, but compare current URL limits, concurrency, rendering options, storage, privacy and retention, failure handling, and total cost for your expected workload. Those terms differ by provider and can change, so check the provider’s current documentation before committing to a recurring job.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Or skip the browser setup

For a hosted capture option, ScreenshotNeo returns a screenshot or PDF from one GET request. Its request parameters also work with the names used by other screenshot APIs, which can make switching easier. The API supports bulk capture of up to 100 URLs per call, alongside options such as full-page capture, viewport and device presets, format, scale, and image resizing. See the ScreenshotNeo API documentation for request options.

This example saves a WebP screenshot of one URL; replace the target URL and set your 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

ScreenshotNeo accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. It also provides an MCP server for AI agents, including Claude, Cursor, and other MCP clients, with tools for screenshots, page information, and PDF capture.

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

The Free plan includes 1,000 screenshots per month with no card required. Paid plans start at $5 for 3,000 screenshots; every feature is on every plan. Sign up for ScreenshotNeo’s free plan to start with 1,000 screenshots a month and no card.

Frequently Asked Questions

Can one input URL appear more than once in the list?

Yes. The example uses the row number as part of each output filename, so repeated URLs produce separate files and manifest entries.

Does a saved screenshot prove the page was accessible to a normal visitor?

No. It records what the configured browser rendered in that run; it does not establish how the page behaves for every user, location, or session.

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.

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

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.