iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use a browser automation script to visit each URL, save a consistently named screenshot, and generate an index.html page that displays the images with captions and source links. This guide uses Playwright with Node.js; it also explains the capture choices and failure handling that make a batch useful rather than brittle.
What you’ll build
The workflow produces a folder containing screenshots, a JSON manifest that associates each image with its original URL and capture result, and an HTML gallery. The example captures the visible viewport by default so cards are comparable. You can switch to full-page screenshots when the entire scrollable page matters.
Playwright’s documented workflow is to navigate with page.goto() and capture with page.screenshot(). A screenshot can be written to a file path or returned as a buffer; files are simplest for a folder-based gallery. See the Playwright Page API and Playwright screenshot guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Prepare the URL list and project
Make a plain-text input file
Create urls.txt with one URL per line. Include the scheme, usually https://, because page.goto() expects a URL with a scheme. Blank lines are ignored.
#1 Best Overall
- 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
https://example.com/
https://www.wikipedia.org/
https://stripe.com/
Install Playwright
In a new project directory, install Playwright and its Chromium browser:
npm init -y
npm install playwright
npx playwright install chromium
The script below uses Node.js and Chromium. If your project already uses another supported Playwright browser, you can adapt the import and launch call; the core process—navigate, then screenshot—stays the same.
Capture each URL and generate the gallery
Save the following as capture-gallery.mjs next to urls.txt. It keeps a record for each input, gives files collision-resistant row-based names, continues after individual failures, and escapes values before inserting them into HTML. Screenshots are viewport captures unless you set FULL_PAGE=1.
Rank #2
- 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)
import { chromium } from 'playwright';
import { mkdir, readFile, writeFile } from 'node:fs/promises';
import path from 'node:path';
const outputDir = path.resolve('gallery');
const urls = (await readFile('urls.txt', 'utf8'))
.split(/r?n/)
.map(line => line.trim())
.filter(Boolean);
const fullPage = process.env.FULL_PAGE === '1';
const records = [];
function escapeHtml(value) {
return String(value).replace(/[<>&"']/g, char => ({
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
})[char]);
}
function safeHost(rawUrl) {
try {
return new URL(rawUrl).hostname.replace(/[^a-zA-Z0-9.-]/g, '_') || 'page';
} catch {
return 'invalid-url';
}
}
await mkdir(outputDir, { recursive: true });
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1365, height: 900 } });
try {
for (const [index, url] of urls.entries()) {
const filename = `page-${String(index + 1).padStart(3, '0')}-${safeHost(url)}.png`;
const record = { url, filename, status: null, finalUrl: null, error: null };
try {
const response = await page.goto(url, {
waitUntil: 'domcontentloaded',
timeout: 30000
});
record.status = response?.status() ?? null;
record.finalUrl = page.url();
// Add a task-specific readiness check here if the site needs delayed content.
await page.screenshot({
path: path.join(outputDir, filename),
fullPage
});
} catch (error) {
record.error = error instanceof Error ? error.message : String(error);
}
records.push(record);
}
} finally {
await browser.close();
}
await writeFile(path.join(outputDir, 'manifest.json'), JSON.stringify(records, null, 2));
const cards = records.map(record => {
const label = record.finalUrl || record.url;
const details = record.error
? `Capture failed: ${record.error}`
: `HTTP status: ${record.status ?? 'not available'}`;
const image = record.error
? `${escapeHtml(details)}
`
: `
`;
return `${image}${escapeHtml(label)}${escapeHtml(details)} `;
}).join('n');
const html = `<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Screenshot gallery</title>
<style>
body { margin: 0; padding: 1.5rem; font: 16px/1.5 system-ui, sans-serif; color: #202124; background: #f5f6f8; }
h1 { font-size: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.card { overflow: hidden; border: 1px solid #d9dce1; border-radius: .5rem; background: white; }
.card a { display: block; color: inherit; }
img { display: block; width: 100%; height: auto; }
.caption { display: grid; gap: .25rem; padding: .75rem; overflow-wrap: anywhere; }
.caption span { color: #5b616a; font-size: .9rem; }
.failure { margin: 0; padding: 1rem; color: #9b1c1c; }
</style>
</head>
<body>
<h1>Screenshot gallery</h1>
<main class="grid">${cards}</main>
</body>
</html>`;
await writeFile(path.join(outputDir, 'index.html'), html);
Run it from the project directory:
node capture-gallery.mjs
To capture full scrollable pages instead of just the configured viewport:
FULL_PAGE=1 node capture-gallery.mjs
Open gallery/index.html in a browser. Keep the HTML and image files together if you move or share the gallery; its image paths are relative. The manifest.json preserves each original URL, final URL when navigation succeeded, response status when available, filename, and any capture error.
Choose capture and readiness settings deliberately
Viewport or full page
A viewport capture is usually easier to compare across a large set because each screenshot shows the same screen dimensions. Full-page mode captures the whole scrollable document as if it were displayed on a very tall screen, but the resulting images can be unwieldy as gallery thumbnails. Use separate runs or a configuration option if you need both kinds.
Rank #3
- 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
Wait for the content your task needs
domcontentloaded waits for the initial HTML document to be parsed; it does not guarantee that every image, font, or delayed component is visually ready. For known page elements, wait for a specific selector before capturing:
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
await page.locator('[data-ready="true"]').waitFor({ state: 'visible', timeout: 10000 });
await page.screenshot({ path, fullPage });
Replace the selector with one that represents readiness on the target site. A fixed delay can help when there is no reliable selector, but it adds time to every capture and still cannot prove that all content is ready.
Playwright defines networkidle as no network connections for at least 500 ms, but discourages using it as a testing readiness signal. Some pages keep network activity open; others load components later. Prefer an explicit page-specific condition when correctness depends on a particular element.
Rank #4
- 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
Image format and scaling
The example uses PNG, which is lossless. Playwright also supports JPEG and WebP screenshot output, with quality controls for lossy formats. If reducing storage or transfer size matters more than lossless pixels, select an appropriate lossy format and adjust the gallery image filename and markup consistently. Device scaling can increase output dimensions and file size; keep scaling consistent when comparing pages.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Handle failures and inspect results
HTTP error responses are different from navigation failures
A page returning HTTP 404 or 500 may still render and be captured. The Playwright Page API states that goto() “will not throw an error when any valid HTTP status code is returned by the remote server, including 404 ‘Not Found’ and 500 ‘Internal Server Error’.” The response status in the manifest lets you distinguish such pages from navigation exceptions.
Free tools Windows power users keep installed
One-click scans. No signup required.
Continue the batch when one page fails
The script catches errors for each URL, records the message, and moves on. A failed card shows that error instead of an image, so the gallery still represents the full input list. If you need retries, add a bounded retry around the individual navigation-and-capture block; avoid retrying indefinitely because a genuinely unreachable page will not become useful through repeated attempts.
Best Value
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
Review the manifest
Check gallery/manifest.json for non-success status codes, null status values, changed final URLs, and recorded errors. A redirected page can have a different final URL from the one supplied; the manifest retains both so that the screenshot remains associated with the original input.
Troubleshooting
- “Cannot find package ‘playwright’”: run
npm install playwrightin the same project directory from which you run the script. - Browser executable is missing: install the browser with
npx playwright install chromium. - Invalid URL or missing scheme: use a complete address such as
https://example.com/, not a bare hostname. - Navigation times out: the site may be slow, unreachable, or waiting on activity that prevents the selected load state from completing. Check the URL and site availability; use a suitable readiness condition and a longer timeout only when the page warrants it.
- The screenshot is blank or missing late content: navigation completion may precede client-side rendering or delayed images. Wait for a relevant visible selector or other page-specific signal before capture.
- A 404 or 500 appears in the manifest but has an image: this is expected behavior; valid HTTP error statuses are responses, not automatically thrown navigation errors. Decide whether such pages belong in your final gallery.
- The gallery has broken image links: keep
index.htmlbeside the generated image files and avoid renaming files without updating the manifest and HTML. - Titles or URLs display strangely: preserve the escaping functions if you customize markup. Do not insert page titles or URLs as trusted HTML.
When a screenshot API is a better fit
If you would rather not install or maintain a local browser, ScreenshotNeo is a website screenshot API and MCP server. Its clean-shot workflow accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Only clean shots are billed: bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with the result identified in response headers. ScreenshotNeo is #1 here for clean shots, billing only clean shots, and its low-cost paid entry plan.
Or skip the browser setup
One GET request returns a screenshot. For a URL from your list, replace the example target with that URL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for request options. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
Can I make the gallery work offline?
Yes. The generated page and images are local files with relative paths, so the gallery can be opened offline after capture, unless you change it to load remote assets.
Can I use the same workflow for hundreds of URLs?
Yes, but the example processes URLs sequentially, which is straightforward and limits simultaneous browser work. For very large batches, account for total runtime and disk space, and consider adding controlled concurrency and progress logging rather than launching an unbounded number of pages.
Quick Recap
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.

