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

Use one Playwright browser, a reusable context, and a controlled loop (or bounded worker pool) to capture a list of URLs. Navigate each page with an explicit readiness and timeout policy, write deterministic filenames, and close resources in finally. The complete Node.js example below captures full-page PNGs, records per-URL failures, and keeps the batch moving.

Complete bulk screenshot script

Install Playwright and its browser binaries in your project:

npm install playwright
npx playwright install chromium

Save this as bulk-screenshots.mjs. It creates the output directory, sanitizes names, reuses one browser and context, and handles each target independently.

import { chromium } from 'playwright';
import { mkdir } from 'node:fs/promises';
import path from 'node:path';

const targets = [
  { url: 'https://example.com', slug: 'example' },
  { url: 'https://playwright.dev', slug: 'playwright' },
  { url: 'https://news.ycombinator.com', slug: 'hacker-news' },
];

const outputDir = path.resolve('screenshots');
const safeSlug = (value) => value.toLowerCase()
  .replace(/[^a-z0-9-_]+/g, '-')
  .replace(/^-+|-+$/g, '') || 'page';

await mkdir(outputDir, { recursive: true });
const browser = await chromium.launch();
const context = await browser.newContext({
  viewport: { width: 1440, height: 900 },
  deviceScaleFactor: 1,
});
const page = await context.newPage();
const failures = [];

try {
  for (const [index, target] of targets.entries()) {
    const filename = `${String(index + 1).padStart(3, '0')}-${safeSlug(target.slug)}.png`;
    try {
      await page.goto(target.url, {
        waitUntil: 'networkidle',
        timeout: 45_000,
      });
      await page.screenshot({
        path: path.join(outputDir, filename),
        fullPage: true,
        type: 'png',
        scale: 'css',
        timeout: 30_000,
      });
      console.log(`Saved ${filename}`);
    } catch (error) {
      failures.push({ url: target.url, error: error.message });
      console.error(`Failed ${target.url}: ${error.message}`);
    }
  }
} finally {
  await context.close();
  await browser.close();
}

if (failures.length) {
  console.error(JSON.stringify({ failures }, null, 2));
  process.exitCode = 1;
}

Run it with node bulk-screenshots.mjs. The default screenshot is the visible viewport; fullPage: true captures the complete scrollable document, as though it were displayed on a screen tall enough to contain it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Prepare inputs and filenames safely

Use records, not parallel arrays

Keep the URL and its intended name together: { url, slug }. This prevents a reordered URL list from receiving the wrong filename. If URLs come from CSV or a database, validate that each is an absolute HTTP(S) URL before navigation.

Guarantee unique, filesystem-safe paths

Slugs can contain slashes, query punctuation, Unicode, or duplicates. Sanitize them and add an index, database ID, or hash. Never let an input URL directly determine a path; characters such as / can create unintended directories, while duplicate slugs silently overwrite prior captures.

Create output before navigation

mkdir(..., { recursive: true }) makes a clean run work on a new machine and in CI. For resumable jobs, write to a temporary filename and rename it only after a successful screenshot, or skip files that already pass your validation check.

Choose viewport or full-page capture

Viewport screenshots

Omit fullPage (or set it to false) when you need exactly what a user sees at a fixed width and height. This is appropriate for visual regression baselines, hero sections, and responsive breakpoint checks.

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

Full-page screenshots

Set fullPage: true for long documents. Lazy-loaded content may not exist until scrolling triggers it; let the application load those images or scroll deliberately before capture. Very tall pages can consume substantial memory and produce large files, so consider element or clipped captures for enormous documents.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Element or rectangle captures

Capture a component with a locator and locator.screenshot(), or pass clip: { x, y, width, height } to select a rectangle. Element captures are often more stable than full-page images when navigation, ads, or personalized modules change around the target.

Make pages deterministic

Wait for meaningful application state

networkidle is only a network heuristic. Analytics, WebSockets, and polling can prevent it—or it can occur before a client-rendered chart is usable. Prefer a page-specific signal:

await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 45_000 });
await page.locator('[data-test="report-ready"]').waitFor({ state: 'visible', timeout: 20_000 });

For a known delay, use await page.waitForTimeout(1000), but a selector or application event is generally less wasteful and more reliable.

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.

Freeze motion and volatile regions

Animations, rotating carousels, timestamps, and user-specific widgets create pixel differences. Playwright can inject screenshot-only CSS with style and hide changing content with mask:

await page.screenshot({
  path: 'screenshots/stable.png',
  fullPage: true,
  style: `*, *::before, *::after {
    animation: none !important;
    transition: none !important;
    caret-color: transparent !important;
  }`,
  mask: [page.locator('.live-clock'), page.locator('[data-personalized]')],
});

Use a stable browser engine, viewport, device scale, locale, timezone, and authentication state when comparing runs. Accept cookies or set a deterministic state before capture if a consent dialog would obscure the page.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Screenshot options that matter in a batch

Option Use Trade-off
type png, jpeg, or webp PNG preserves lossless detail; JPEG/WebP usually reduce storage.
quality JPEG quality from 0 to 100 Only applies to JPEG; lower values reduce bytes and fidelity.
scale css or device pixels CSS scale is smaller and easier to compare; device scale is sharper but larger.
clip Capture a specified rectangle Efficient, but coordinates must match the intended layout.
mask Cover sensitive or dynamic locators Improves repeatability while hiding the masked content.
style Apply temporary CSS during capture Changes only the screenshot, not page behavior.
timeout Limit screenshot completion time Prevents a stuck page from blocking the entire batch.

Concurrency without exhausting the machine

A single shared page is simplest and minimizes browser overhead. Independent URLs can run in parallel, but do not create an unbounded promise for every input. Use a bounded worker pool: each worker owns a page (or context), takes the next index, navigates, captures, and records errors. The appropriate worker count depends on page weight, available CPU and memory, network capacity, and the target site’s limits; Playwright’s official documentation does not publish a universal throughput number. Measure your workload, then increase concurrency until latency, failures, or resource use becomes unacceptable.

Separate contexts provide isolated cookies and storage. Reuse a context when all pages share the same state; create a context per account or locale when they do not. Always close workers in a finally block.

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

Retries, failures, and CI reporting

Catch errors inside the URL loop so one timeout does not discard successful files. Retry transient navigation failures with a small, bounded count and a delay; do not blindly retry deterministic 404s or authentication errors. Record URL, attempt, error message, and (when available) HTTP status. A CI job can continue to collect all results and exit nonzero at the end, as the example does.

  • Use a longer navigation timeout for slow origins, but keep a separate screenshot timeout.
  • Capture a diagnostic screenshot or HTML on failure when the page partially loaded.
  • Respect robots, authentication, rate limits, and terms for every target.
  • Keep secrets out of URLs and logs; use Playwright context credentials or environment variables.

Command-line captures

For one-off jobs, the Playwright CLI supports full-page output, a filename, image type, and high-resolution mode:

npx playwright screenshot --full-page --filename=shot.png --type=png https://example.com
npx playwright screenshot --hires --filename=shot.webp --type=webp https://example.com

The Node.js API is preferable for batches because it gives you input validation, naming, readiness checks, retries, and structured reporting.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
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 is a website screenshot API and MCP server when you want a URL-to-image request instead of maintaining Playwright browsers. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and whether the request was billed. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

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

One request returns PNG, JPEG, WebP, or PDF. The service also supports full-page and CSS-selector captures, dark mode, device presets or custom viewports, retina scale, PDF paper and page settings, custom CSS and JavaScript, pre-capture clicks, selector hiding, selector/delay/network-idle waits, request and resource blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk requests of up to 100 URLs, a usage API, and an OpenAPI specification. Common parameter names used by other screenshot APIs are accepted to ease migration.

Using the API documentation, a cURL batch call can look like this:

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

Python:

import requests
r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

Troubleshooting common failures

Timeout waiting for navigation

Check DNS, TLS, redirects, login requirements, and the target’s network calls. Use domcontentloaded plus a specific readiness locator, and raise the timeout only when the workload genuinely needs it.

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

The screenshot is blank or incomplete

Wait for a visible application marker, ensure the correct frame is loaded, and scroll or trigger lazy loading before a full-page capture. Check whether a cookie dialog or bot challenge covers the document.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Files overwrite each other

Make slugs unique and include an index or stable ID. Log the final absolute path for every successful capture.

CI images differ from local images

Pin the Playwright version and browser installation, set viewport and scale explicitly, disable animation, fix locale/timezone, and mask dynamic regions. Fonts installed on the runner can also change layout.

Out-of-memory or very slow batches

Reduce concurrency, reuse contexts, capture an element instead of a huge document, choose CSS scale, and close pages promptly. Profile CPU, memory, file size, and failure rate before changing worker counts.

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

Practical checklist

  • Validate URLs and assign unique sanitized names.
  • Create the output directory before starting.
  • Set viewport, scale, image type, and full-page behavior deliberately.
  • Wait for application state, not only network idle.
  • Freeze animations and mask volatile or sensitive regions.
  • Catch and report each URL’s failure; retry only transient errors.
  • Bound concurrency and measure the target workload.
  • Close pages, contexts, and the browser in finally.
  • Keep credentials and private captures out of logs and repositories.

Frequently Asked Questions

Can Playwright save screenshot bytes instead of a file?

Yes. Omit path from page.screenshot(); it returns a buffer that you can upload, hash, or process before writing.

Which browser engine should a batch use?

Chromium is a practical default, but Playwright also supports its other installed engines. Use the same pinned engine for reproducible comparisons.

How many pages should run concurrently?

There is no universal official number. Benchmark your page weight, runner resources, origin limits, latency, and failure rate with a bounded worker count.

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.