Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › browser automation

How to Bulk Screenshot URLs and Name Files After Page Titles

By Freedom251 Team · · 5 min read

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.

Use Playwright to loop through a URL list, read each page’s title, sanitize it into a safe filename, and save a screenshot. Add an index to each filename so pages with identical titles do not overwrite one another.

Bulk screenshot URLs with page-title filenames

Playwright does not need a special bulk-screenshot command for this workflow: navigate to each URL, retrieve its title, and save its screenshot inside a loop. The script below uses Python’s synchronous API and Chromium. It creates a numbered PNG for each URL and captures the full scrollable page.

As an Amazon Associate I earn from qualifying purchases.

from pathlib import Path
import re
from playwright.sync_api import sync_playwright

urls = [
    "https://example.com/",
    "https://www.python.org/",
]

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

def safe_stem(title: str, fallback: str) -> str:
    # Replace common reserved characters and control characters.
    stem = re.sub(r'[<>:"/\|?*x00-x1f]', "_", title).strip(" .")
    return (stem or fallback)[:150]

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    for index, url in enumerate(urls, start=1):
        page.goto(url, wait_until="domcontentloaded")
        title = page.title()
        stem = safe_stem(title, f"page-{index:03d}")
        path = out_dir / f"{index:03d}-{stem}.png"
        page.screenshot(path=str(path), full_page=True)
    browser.close()

Install Playwright and its Chromium browser before running the script:

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
python bulk_screenshot.py

The screenshots directory is created relative to the current working directory. Each saved image uses the URL’s position in the input list plus the sanitized page title, for example 001-Example-Domain.png. Playwright infers the image format from the filename extension. Its documented screenshot examples use page.screenshot(path="screenshot.png"), while full_page=True captures the full scrollable page. See the Playwright screenshots guide, getting started documentation, and Page API.

#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

Choose capture scope and loading behavior

Viewport or full page

In the example, full_page=True captures beyond the initial viewport. Remove that argument for a standard viewport screenshot. Full-page capture can be substantially taller than a viewport image on long pages.

When to take the screenshot

wait_until="domcontentloaded" waits for the initial HTML document to be parsed, but it does not guarantee that every image, client-rendered component, or late title update is finished. If the page needs more time, use an appropriate navigation wait condition or wait explicitly for a selector or delay before calling page.title() and page.screenshot(). Choose based on how the target site loads; a single wait condition is not reliable for every site.

Pages that depend on login, interaction, or automation-sensitive behavior may need additional handling. The basic loop does not authenticate, dismiss dialogs, or interact with the page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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

Make filenames safe and collision-resistant

A document title is arbitrary page content, not a guaranteed-safe filename. The sample replaces common reserved characters and control characters, trims spaces and dots at the ends, limits the title portion to 150 characters, and falls back to a numbered page name if the title is blank. Filename restrictions differ by operating system and filesystem, so adapt the cleanup if you target a particular environment.

The numeric prefix prevents two pages with the same title from overwriting each other during a single run. If the order of URLs may change between runs and stable names matter, append a stable URL-derived identifier instead of relying only on the list index. Be mindful that URLs can contain sensitive query parameters before using them in filenames.

Adapt the script to your batch

Capture only the viewport

Change the screenshot call to page.screenshot(path=str(path)). The output extension still determines the image format; choose a supported extension appropriate to your needs.

Rank #3
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.

Use asynchronous Python

Playwright also documents an asynchronous API. Use it when integrating the capture loop into an async application; the sequence remains the same: navigate, get the title, sanitize it, then save the screenshot. The official documentation includes both sync and async patterns and browser engines including Chromium and WebKit; install and select the browser your project requires.

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

Handle individual failures

For a long URL list, wrap each navigation and capture in per-URL exception handling so a failed page does not stop the rest of the batch. Log the URL and exception, and continue to the next item. If the run must be repeatable, write a separate results log recording successful output paths and failed URLs.

Troubleshooting

  • Browser executable missing: run python -m playwright install chromium in the same environment where Playwright is installed.
  • Navigation times out: the site may be slow, unreachable, or waiting on resources that never finish. Set a suitable timeout and select a wait condition that fits the target page; avoid assuming every site reaches the same readiness state.
  • Title or content is incomplete: domcontentloaded may occur before client-rendered content or a title update. Wait for the relevant selector, a suitable delay, or a more appropriate page readiness condition before reading the title and capturing.
  • Two screenshots appear to be missing: title-only names can collide. Keep the index prefix or add another unique component to the filename.
  • Invalid or awkward filenames: broaden the sanitization for your operating system, preserve a fallback for empty titles, and shorten the title if the full path becomes too long.
  • The screenshot cuts off content: set full_page=True for the full scrollable page; without it, the capture is limited to the viewport.

Performance, reliability, and cost

This script processes URLs sequentially in one page, which is simple and limits simultaneous browser work. Runtime depends on the sites, navigation waits, and page sizes; the reviewed Playwright documentation does not establish a throughput figure for this particular loop. Parallel workers can increase throughput but also increase resource use and the chance of rate limits or site-side blocking, so introduce concurrency only when appropriate for the target sites and environment.

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

Playwright is a browser automation workflow: you install and run a browser, and your environment handles storage, retries, and logging. The script itself has no per-screenshot service charge, but it does not provide a hosted capture service or automatic recovery. For unattended jobs, record each result and make retries selective rather than rerunning successful captures unnecessarily.

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 one-request screenshot API and an MCP server for AI agents. A basic cURL request saves an image from a URL:

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://stripe.com -o shot.webp

For full options and response behavior, see the ScreenshotNeo API documentation. ScreenshotNeo returns a screenshot or PDF, but adding page titles to filenames in a batch still requires your own naming logic around each request.

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.
  • Cookie/consent banners, newsletter popups, and chat widgets are removed before capture; each cleanup step can be turned off.
  • Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report page verdict and billing status.
  • An MCP server gives AI agents tools for screenshots, page information, and PDF capture.
  • The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.

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

Frequently Asked Questions

Does Playwright provide a built-in bulk screenshot command?

No. The workflow here is a loop over URLs that calls Playwright’s page navigation and screenshot APIs for each page.

Can I use another browser engine?

Yes. Playwright supports multiple browser engines, including Chromium and WebKit; install the browser and launch the engine appropriate to your project.

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.

browser automationPlaywrightPythonscreenshotsweb automation

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.

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.