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

How to Create Thumbnail Images for Hundreds of URLs with Playwright

A practical Playwright workflow for capturing and tracking thumbnails across hundreds of URLs, with readiness choices, error handling, and scaling advice.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Playwright to open each URL, wait for the page content you need, capture a viewport screenshot, and save a result record for every URL. A browser loop is enough for the basic batch; reliable runs also check HTTP status, log navigation failures, use stable filenames, and limit concurrency to what your machine can handle. Playwright does not choose your final thumbnail dimensions, so resize or crop the captured image to match your destination.

Build a repeatable capture pipeline

The workflow has five parts: load the URL list, navigate to each page, wait for the right content, capture an image, and record the outcome. Reuse one browser process for the run, but manage pages or contexts so resource use stays bounded. The example below processes URLs sequentially for simplicity; for hundreds of pages, add bounded concurrency only after checking memory and behavior on your own workload.

As an Amazon Associate I earn from qualifying purchases.

  1. Give every input URL a stable index or identifier for its output filename. Avoid turning raw URLs into filesystem paths.
  2. Navigate using an intentional readiness signal.
  3. Check the navigation response status separately from thrown errors.
  4. Capture a viewport, full page, or a selected element, depending on the thumbnail’s purpose.
  5. Save a manifest mapping the input and final URL, status, output path, and any error.

Playwright’s documented navigation and screenshot primitives are page.goto() and page.screenshot().

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

Install Playwright and prepare a URL list

This JavaScript example uses Playwright’s Node.js library. Install it and its browser binaries in your project:

#1 Best Overall
Sale
Liene M100 4x6'' Photo Printer, Phone Printer 100 Sheets & 3 Cartridges, Full-Color Photo, Portable Instant Photo Printer for iPhone Android, Thermal Dye Sublimation, Wi-Fi Picture Printer 100 Papers
  • User-Friendly Portable Photo Printer for iPhone, Android & PC - Get beautiful and colourful memories with Liene 4x6 photo printer! After opening the entire package, you can find one cartridge + 20 sheets of photo paper (placed inside the machine packaging), as well as an additional box containing 80 sheets of photo paper (which includes two cartridges + 80 sheets of photo paper). Full package includes smartphone photo printer, Liene 4x6 photo printer papers (100 sheets), 3 colour cartridges, and fully sealed cassette to prevent dust. Minimalist and magnetic design for compact storage.
  • Superior Quality 4x6 Photo Printer - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Clean the print head promptly if smudges are observed on printed photos during operation. Get Liene photo printers now for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Wi-Fi Photo Printer for Smartphone - The built-in hotspot of the photo printer makes it easy to print pictures from your phone, avoiding outside interference with a fast and stable connection. No other networks required! Simply connect your device to the independent instant photo printer 4x6 hotspot.
  • Multiple Device Compatibility - Liene phone printer provides instant photo printing for up to 5 simultaneous connections. Share with family and friends or print from your different devices. No additional cables or Bluetooth required when printing photos with this picture printer. Note: Ensure the ink cartridge clicks into place before printing.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Square border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this photo printer for iphone 4x6 prints.

npm install playwright

Then create urls.txt with one URL per line, for example:

https://example.com
https://playwright.dev
https://stripe.com

The script below saves viewport PNGs in thumbnails/ and writes a JSON Lines manifest to results.jsonl. Each manifest line records the input URL, final URL when available, status, output path, and error if a page could not be captured.

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.

Runnable batch script

Save this as capture.mjs and run it with node capture.mjs. The default readiness condition is domcontentloaded; replace or supplement it with a selector wait for sites whose preview content appears asynchronously.

import { chromium } from 'playwright';
import { readFile, mkdir, appendFile } from 'node:fs/promises';

Rank #2
KODAK Dock Plus 4x6 Photo Printer, Smartphone Docking, 4PASS, 50 Sheets
  • Dock Photo Printer: The KODAK Dock Plus is a home photo printer that produces high-quality 4x6” prints directly from compatible smartphones. Featuring an integrated docking station, users can place their phone on the printer for better connection while simultaneously charging the device during printing.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Dock Plus is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Home Printing Station: Designed for stable desktop use, this dock photo printer connects to a power outlet for consistent performance and larger 4x6” prints. Ideal for home printing, photo albums, framing, family events, and everyday picture printing.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

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

await mkdir('thumbnails', { recursive: true });
await writeFileIfMissing('results.jsonl');

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

const browser = await chromium.launch();
try {
for (const [index, url] of urls.entries()) {
const outputPath = `thumbnails/${String(index + 1).padStart(4, '0')}.png`;
let record = { index, inputUrl: url, finalUrl: null, status: null, outputPath, error: null };
const page = await browser.newPage({ viewport: { width: 1280, height: 800 } });

try {
const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
record.finalUrl = page.url();
record.status = response ? response.status() : null;

// Optional: wait for a site-specific preview target, e.g. await page.locator('main').waitFor();
if (response && response.status() >= 400) {
record.error = `HTTP ${response.status()}`;
} else {
await page.screenshot({ path: outputPath, type: 'png' });
}
} catch (error) {
record.finalUrl = page.url();
record.error = error instanceof Error ? error.message : String(error);
} finally {
await page.close();
await appendFile('results.jsonl', `${JSON.stringify(record)}n`);
}
}
} finally {
await browser.close();
}

Rank #3
Nelko PP01 Photo Printer, 2x3 Portable Photo Printer, Mini Printer, White | Instant Color Sticker Printer for Smartphones, Sticky-Back Photos, Bluetooth Compatible with iOS & Android, AI App Editing
  • 2x3" Portable Photo Printer: The upgraded PP01 photo printer uses advanced inkjet technology. This portable photo sticker printer produces vivid, full-color prints on premium sticky-backed photo paper that is smudge-proof, water-resistant, and tear-resistant. The Nelko mini photo printer is pocket-sized and weighs only 308 g, making it ultra-portable for school, travel, and field trips. Each ink cartridge prints up to 80 full-color 2x3 photos on sticky-backed paper
  • Easy Printing via Bluetooth: The PP01 mini photo printer is compatible with iOS and Android phones via Bluetooth. Simply download the Nelko app from Google Play or the App Store. Load the 2x3 photo paper with the smooth side facing down. Install the ink cartridge, connect via Bluetooth, and print directly using the Nelko app. A USB charging cable is included; the adapter is not included
  • High-Quality Photos: This mini photo sticker printer uses advanced inkjet technology for clear, vibrant prints. This portable photo printer produces 600 DPI high-resolution images with precise colors, capturing fine details and realistic tones. Each photo comes with adhesive backing, ideal for scrapbooks and preserving your memories with this sticker printer. Personalize every photo for holidays, birthdays, or daily events
  • Powerful App: The Nelko 2x3" PP01 photo printer app lets you edit photos and offers a variety of frame designs, making it perfect for personalizing your photos for projects like scrapbooking or journaling. Download the Nelko app to create collages and customize photos with filters, graffiti, borders, stickers, text, AI image editing, and many other features. Edit photos on your phone, then send them to the Nelko app for instant printing in under 90 seconds
  • Versatile Uses: This portable photo printer is ideal for travel journals, party favors, and family gatherings. Students use it for planners and photo printing. Crafters use it for DIY projects, custom labels, and scrapbooking. It's a practical photo sticker printer for bloggers, small businesses, and event photographers to create instant giveaways. Create holiday surprises and capture heartfelt moments with loved ones by printing photos on Nelko sticky-backed photo paper.

async function writeFileIfMissing(path) {
try {
await readFile(path);
} catch {
await appendFile(path, '');
}
}

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

If you want to keep HTTP error pages as diagnostic images instead of rejecting them, remove the status-based skip and record the status alongside the screenshot. A completed navigation to a 404 or 500 response does not itself throw: the script explicitly checks the response code. See Playwright’s Page API for navigation response and failure behavior.

Choose the right readiness signal

page.goto() supports commit, domcontentloaded, load, and networkidle as navigation wait options. These indicate different lifecycle points; none guarantees that the particular text, image, or widget you want in the thumbnail is ready.

  • domcontentloaded: a useful starting point for ordinary pages, but content populated by later scripts may still be missing.
  • load: waits for the load event, which can take longer and still may not represent application-specific readiness.
  • commit: waits for navigation to commit, not for the document’s content to finish loading.
  • networkidle: Playwright marks this as discouraged as a general testing signal; background requests can make it unsuitable. Its documented definition is no network connections for at least 500 ms.

When a page renders the preview target asynchronously, wait for a relevant locator instead, such as await page.locator('main h1').waitFor(), or wait for a known application state. Playwright advises relying on assertions for readiness rather than treating network silence as proof. Details are in the Page API documentation.

Choose what the thumbnail represents

Capture Use it when Playwright approach
Viewport You want a compact preview of what a visitor initially sees. await page.screenshot({ path: outputPath })
Full page The whole scrollable document must be represented, though the result may be unusually tall for a thumbnail. await page.screenshot({ path: outputPath, fullPage: true })
One element The thumbnail should show a specific card, hero, or other component rather than the whole page. await page.locator('.hero').screenshot({ path: outputPath })

Playwright can save a screenshot to a path or return image bytes for a separate processing step. If your publishing destination requires fixed dimensions, capture first and then use an image-processing step to crop or resize; the destination’s required dimensions and quality settings are not defined by Playwright. The official examples cover file, full-page, buffer, and element capture and the Python screenshot API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Liene Amber M110 Bluetooth Portable Photo Printer for iPhone, Thermal Dye Sublimation, Includes 80 Sheets, 60 4x6 Inch Sheets, 20 3 Inch Square Sticker Sheets and 2 Cartridges
  • Dual 4x6" & 3x3" Photo Printer Paper Tray Convenience: Seamlessly print both 6-inch standard photo paper and 3-inch sticky-backed paper with our innovative dual tray design. This compact phone photo printer for smartphone offers easy storage and quick access, making it perfect for diverse printing needs without taking up much space. Enjoy vibrant, high-quality prints every time.
  • Fast Bluetooth Connectivity: Experience lightning-fast printing with our liene photo printer's Bluetooth connection, which pairs in just 13 seconds. Enjoy a seamless and efficient printing experience, perfect for capturing and sharing memories on the go without the hassle of cables or complex setups.
  • Superior Quality Photo Printer 4x6 - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Get Liene photo printers now as amazing gifts for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Multiple Device Compatibility - Liene picture printer for iphone provides instant photo printing for up to mutiple simultaneous connections. Share with family and friends or print from your different devices. No additional cables required when printing photos with this phone printer.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Polaroid border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this iphone photo printer for 4x6 & 3x3 prints.

Scale safely across hundreds of pages

There is no universal worker count or runtime for hundreds of unrelated sites. Pages differ in scripts, media, redirects, blocking, and load time, while browser pages consume memory. Begin sequentially, observe how the actual run behaves, and increase concurrency gradually if the host has capacity. Close each page after its result is recorded, and always close the browser in a finally block.

  • Keep output names deterministic: use an index or an identifier derived from your own input data so duplicate URLs and unusual URL characters do not collide.
  • Keep a manifest: save input URL, final URL, response status, output path, and error. It makes failures reviewable and lets you retry specific entries.
  • Set a timeout deliberately: the example uses 30 seconds per navigation; adjust it to your workload rather than assuming every site will finish within that interval.
  • Decide how to treat errors: capture HTTP error pages for diagnosis or mark them failed and omit the image. Do not confuse an error response with a successful page.
  • Measure your workload: Playwright’s documentation describes APIs, not a throughput benchmark for hundreds of arbitrary URLs.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

The page loads, but the thumbnail misses the main content

The navigation event may have occurred before the relevant content was rendered. Wait for a specific visible locator or application condition before taking the screenshot. Do not assume networkidle means the right content is ready.

A 404 or 500 page appears to be a successful navigation

HTTP error responses do not themselves make page.goto() throw. Inspect the returned response status and choose whether to capture the error page or record it as a failed result.

Navigation throws or times out

Keep the exception in the manifest with the URL and retry only under a defined policy. A timeout may reflect a slow or stalled site; a navigation failure may also arise from an invalid URL or browser/network issue. Avoid silently dropping entries.

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

Images are the wrong dimensions or too tall

The default viewport screenshot reflects the configured viewport, while full-page capture spans the scrollable document. Set the viewport intentionally and resize or crop the output afterward to meet the destination’s dimensions.

Best Value
KODAK Mini 2 Retro 2x3 Portable Photo Printer, 4PASS, 38 Sheets, White | Bluetooth, iPhone & Android Smartphone Compatible, Smudge-Proof, Water-Resistant, Fade-Resistant
  • Instant Photo Printing: The KODAK Mini 2 Retro is a portable photo printer designed to turn smartphone pictures into high quality prints in seconds. Whether capturing family moments, travel highlights, journaling pages, or creative projects, this mini printer lets you print real photos anytime, anywhere.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Mini 2 Retro is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Print Anytime, Anywhere: Small enough to fit in your hand, bag, or even a pocket, the Mini 2 Retro is built for on-the-go printing. Ideal for parties, trips, school projects, scrapbooks, and spontaneous moments where you want real prints without waiting.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

The run becomes slow or runs out of memory

Reduce concurrent pages, ensure pages close after each capture, and test whether full-page images are necessary. There is no documented universal concurrency setting for this workload; tune against your machine and target URLs.

Some output files are missing after a run

Check results.jsonl for recorded status and error, and verify that the process could write to the output directory. If a run is interrupted, the per-result manifest makes it possible to identify entries that need retrying.

Or skip the browser setup

ScreenshotNeo provides a screenshot API and MCP server for developers. One GET request can return a screenshot or PDF; its clean-shot flow accepts consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers say which outcome occurred. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to AI agents and MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

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

For a single URL, this cURL call saves a WebP screenshot:

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 API documentation for parameters and batch options, including bulk capture of up to 100 URLs per call. To build a hundreds-of-URLs run, split the input into supported request batches and retain your own URL-to-result manifest.

ScreenshotNeo is an option when you would rather call a screenshot service than operate a browser capture pipeline. Sign up for 1,000 free screenshots a month with no card.

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

Frequently Asked Questions

Does Playwright automatically make a screenshot the thumbnail dimensions I need?

No. It captures the selected viewport, page, or element; resize or crop the result to your destination’s required dimensions.

Will page.goto() throw when a URL returns 404?

Not just because of the HTTP status. Inspect the navigation response status and decide whether to capture or reject that page.

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 *

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.