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×
Skip to content
World desk6 min

How to Save Bulk Website Screenshots With Filenames From Page Titles

A practical Playwright workflow for bulk website screenshots named from page titles, including safe filename cleanup, duplicate handling, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a browser automation script to visit each URL, read its page title, turn that title into a safe, unique filename, and save the screenshot to that path. Playwright supports custom screenshot paths and full-page captures; the URL loop, title cleanup, and duplicate handling are logic you add yourself.

What you need to build

Prepare a list of URLs and use Playwright to navigate to each page. After navigation, read document.title, sanitize the result for your operating system, make the filename unique, and pass it as the screenshot path. The Playwright documentation describes the screenshot path and full-page options, but does not provide a ready-made bulk title-naming command: Playwright’s screenshots API guide and Playwright CLI screenshots and PDF documentation.

As an Amazon Associate I earn from qualifying purchases.

Set up a repeatable URL-to-file workflow

  1. Collect the URLs. Store one URL per entry in an array or input file. Keep this list separate from the script so you can rerun the same batch.
  2. Navigate and wait. Choose a navigation wait condition appropriate to the target pages. There is no single wait condition that guarantees every site has finished rendering; pages that load content dynamically may need extra waiting, scrolling, or interaction.
  3. Read the page title. Use Playwright’s page.title() after navigation.
  4. Make a safe filename. Trim whitespace, replace characters that are invalid or awkward on the target operating system, and provide a fallback for an empty title.
  5. Prevent collisions. Append a stable sequence number to each filename so pages with the same title do not overwrite one another.
  6. Save the capture. Supply the generated path explicitly. Without a custom CLI filename, Playwright’s documented default is timestamp-based, rather than the page title.

Runnable JavaScript example with Playwright

This Node.js script reads URLs from a text file, captures each page, and writes full-page PNGs to an output directory. It uses a sequence number to avoid collisions, including when titles are blank or identical.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install Playwright: npm init -y, then npm install playwright.
  2. Install a browser: npx playwright install chromium.
  3. Create urls.txt with one URL per line.
  4. Save the following as capture.js, then run node capture.js.

capture.js:

const fs = require('node:fs/promises');
const path = require('node:path');
const { chromium } = require('playwright');

function safeTitle(title) {
  const cleaned = title
    .normalize('NFKC')
    .trim()
    .replace(/[\/:*?"<>|u0000-u001f]/g, '-')
    .replace(/s+/g, ' ')
    .replace(/[. ]+$/g, '')
    .slice(0, 120);
  return cleaned || 'untitled-page';
}

async function main() {
  const urls = (await fs.readFile('urls.txt', 'utf8'))
    .split(/r?n/)
    .map(line => line.trim())
    .filter(Boolean);

  await fs.mkdir('screenshots', { recursive: true });
  const browser = await chromium.launch({ headless: true });
  const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });

  try {
    for (let i = 0; i < urls.length; i++) {
      const url = urls[i];
      const number = String(i + 1).padStart(3, '0');
      try {
        await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 45000 });
        const title = await page.title();
        const filename = `${number}-${safeTitle(title)}.png`;
        await page.screenshot({
          path: path.join('screenshots', filename),
          fullPage: true
        });
        console.log(`Saved ${url} -> ${filename}`);
      } catch (error) {
        console.error(`Failed ${url}: ${error.message}`);
      }
    }
  } finally {
    await browser.close();
  }
}

main().catch(error => {
  console.error(error);
  process.exitCode = 1;
});

The script uses domcontentloaded as a practical starting point, not a guarantee that images, fonts, or client-rendered content are ready. Adjust the wait strategy for the pages you capture. A numbered prefix ensures repeated titles produce separate files. The 120-character limit helps keep names manageable, but verify your destination filesystem’s own limits if titles are unusually long.

#1 Best Overall
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner | For Computers including PC and Mac Receipt and Document Scanner USB Powered
  • PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
  • QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
  • VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
  • INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
  • EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0

Choose viewport or full-page capture

  • Viewport: omit fullPage: true to capture only the currently visible browser area.
  • Full page: set fullPage: true to capture the page’s scrollable content.
  • Custom output path: provide a path in the screenshot call, as in the example, to control each file’s name and location.

A full-page capture does not by itself establish that every lazy-loaded or interaction-dependent section has appeared. If the page loads content on scroll, scroll through it or perform the necessary interaction before taking the screenshot, then check representative output files.

Filename choices and edge cases

Invalid characters and empty titles

Windows disallows characters such as / : * ? " < > | in filenames; control characters and trailing periods or spaces can also cause problems. The example replaces these with hyphens and falls back to untitled-page when the title is empty. If your output will be shared across different operating systems, conservative cleanup avoids many portability problems.

Rank #2
Sale
Brother DS-640 Compact Mobile Document Scanner, (Model: DS640)
  • FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
  • READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
  • WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
  • OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)

Duplicate titles

Titles are not guaranteed to be unique. Keep a sequence number, as the script does, or append a short URL-derived suffix. Do not rely on the title alone if a later capture could overwrite an earlier one.

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

Long titles and unusual Unicode

Normalization and a length limit make filenames more manageable, but they can cause two distinct titles to become the same cleaned string. Keep the unique prefix or add another collision check if filenames must be derived primarily from titles. If you need to preserve international characters exactly, test the naming rules on the destination filesystem before running a large batch.

Rank #3
Sale
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
  • STAY ORGANIZED – Easily convert your paper documents into digital formats like searchable PDF files, JPEGs, and more.Power Consumption : 2.5W or less (Energy Saving Mode: 0.7W). Suggested Daily Volume : 500 scans..Does it contain liquid: no
  • CONVENIENT AND PORTABLE –lightweight and small in size, you can take the scanner anywhere from home offices, classrooms, remote offices, and anywhere in between
  • HANDLES VARIOUS MEDIA TYPES – Digitize receipts, business cards, plastic or embossed cards, reports, legal documents, and more
  • FAST AND EFFICIENT – No technical hurdles or complicated setups here; easily scan both sides of a document at the same time, in color or black-and-white, at up to 12 pages-per-minute, and with a 20 sheet automatic feeder
  • BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer

Run large batches responsibly

The example visits URLs sequentially, which is simpler to debug and less likely to overload target sites than launching many pages at once. If you add concurrency for a large list, set a modest limit, account for rate limits, and isolate each page in its own browser page or context. Keep per-URL error handling so one navigation failure does not stop the remaining captures. Use an output directory and a stable prefix so reruns are easy to inspect; decide whether reruns should overwrite earlier files or use a run-specific directory.

Troubleshooting

  • Browser executable missing: run npx playwright install chromium after installing the package.
  • Navigation timeout: the site may be slow or continue network activity. Increase the timeout selectively or use a less restrictive wait condition, then verify the resulting page rather than assuming it fully rendered.
  • Screenshot looks incomplete: wait for a page-specific selector, scroll to trigger lazy content, or perform the required interaction before capture.
  • Files overwrite one another: include a sequence number or URL-derived suffix, rather than using the sanitized title by itself.
  • Filename errors: replace platform-invalid characters, trim trailing periods and spaces, and shorten exceptionally long titles.
  • Some sites show bot checks or access errors: browser automation may receive a different page or be blocked. Do not treat an error page as a valid screenshot of the intended content.

Or skip the browser setup

ScreenshotNeo can capture a URL with one GET request and return an image or PDF. To keep page-title filenames, retrieve the title separately and use your script to save each response under the cleaned, unique name you generate. Its API can capture full pages; see the ScreenshotNeo API documentation.

Rank #4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
  • IRIScan Express, portable scanner : scans color and black and white documents a blazing speed up to 8ppm simplex. Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • IRIScan Express mobile scanner is powered via an included micro USB 2. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan. USB cable provided. AC Adapter not provided and not needed.
  • IRIScan flatbed scanner uses a simplex scanning mode allows for quick and straightforward scanning of single-sided documents. IRIScan with its full portable features is the ideal document scanners for computers.
  • IRIScan document scanner : Versatile scanning capabilities, including scanning to Word, PDF, and Excel formats with companion software provided Readiris OCR
  • Receipt scanner and card scanner with Additional features include scanning business cards directly to Outlook, photo scanning, and receipt scanning for efficient document management

Example request:

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

Cookie banners are accepted and removed before capture, along with known newsletter popups and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. An MCP server provides screenshot tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

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.

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

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Does Playwright automatically use the page title as the screenshot filename?

No. Your script must read the title, make it safe and unique, and pass the resulting path to the screenshot call.

Best Value
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
  • Scanner type: Document
  • Connectivity technology: USB
  • With Auto Scan Mode, the scanner automatically detects what you're scanning
  • Digitize documents and images

Can I save screenshots as JPEG instead of PNG?

Yes. Playwright’s screenshot API supports image formats; choose the format supported by the API and use the matching file extension.

Quick Recap

SaleBestseller No. 3
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer; This product is not intended for scanning photographs on photo paper / photographic media
$153.00
Bestseller No. 4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
Find our Software here : irislink.com/start; IRIScan Express is only compatible Windows platform and not macintosh
$129.00
Bestseller No. 5
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Scanner type: Document; Connectivity technology: USB; With Auto Scan Mode, the scanner automatically detects what you're scanning
$75.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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.