Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk8 min

How to Bulk Screenshot URLs and Log HTTP Errors with Playwright

A practical Playwright workflow for capturing a list of URLs while keeping HTTP responses, browser failures, redirects, and screenshot files distinct in an incremental log.

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.

Use a browser automation script to visit each URL, capture its final main-document response status, save a screenshot, and append one result row per input to a CSV or JSON log. Keep HTTP status separate from capture status: a rendered 404 page can still be screenshotted, while a timeout or DNS failure may produce no screenshot at all.

What to record for every URL

A useful batch log lets you answer two different questions: what HTTP response did the page return, and did the browser successfully save an image? Record these fields for each input:

As an Amazon Associate I earn from qualifying purchases.

  • input_url: the URL as it appeared in your source list.
  • final_url: the page URL after redirects, if navigation reached one.
  • http_status: the final main-document response status, or null when no response was received.
  • capture_status: a separate value such as ok or failed.
  • screenshot_path: the saved image filename, or null if no image was created.
  • error: the exception or failure detail, if any.

This schema is an implementation choice, not a field set that every tool creates automatically. It preserves redirects and distinguishes HTTP errors from navigation, network, and screenshot failures.

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

Bulk screenshot URLs with Playwright

Playwright lets you control navigation and capture directly. Its screenshot documentation covers saving screenshots to files and using the fullPage option to capture the scrollable page.

#1 Best Overall
Sandisk 2TB Extreme Portable SSD, Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware, External Solid State Drive, SDSSDE61-2T00-G25
  • Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
  • Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
  • Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
  • Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
  • Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C

1. Install the browser automation package

For a Node.js project, install Playwright and its browser:

npm install playwright

npx playwright install chromium

2. Put one URL per line

Create urls.txt:

https://example.com
https://example.org
https://example.net/not-found

3. Save this script as bulk-screenshot.mjs

The script below writes a CSV header immediately and appends each result as it finishes. It records the final main-document response status when available, but still attempts to screenshot pages that return HTTP error responses.

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.

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

const inputFile = process.argv[2] ?? 'urls.txt';
const outputDir = 'screenshots';
const logFile = 'results.csv';
const fullPage = process.env.FULL_PAGE === '1';
const timeoutMs = Number(process.env.TIMEOUT_MS ?? 30000);

function csv(value) {
  const text = value == null ? '' : String(value);
  return `"${text.replaceAll('"', '""')}"`;
}

Rank #2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
  • Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
  • Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
  • Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
  • Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
  • From Sandisk, a brand professional photographers trust to take on assignments.

function safePart(value) {
  return value.replace(/[^a-zA-Z0-9._-]+/g, '_').replace(/^_+|_+$/g, '').slice(0, 70) || 'page';
}

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

function screenshotName(index, rawUrl) {
  try {
    const url = new URL(rawUrl);
    return `${String(index).padStart(4, '0')}_${safePart(url.hostname)}_${safePart(url.pathname)}.png`;
  } catch {
    return `${String(index).padStart(4, '0')}_invalid-url.png`;
  }
}

const urls = (await readFile(inputFile, 'utf8'))
  .split(/r?n/)
  .map(line => line.trim())
  .filter(line => line && !line.startsWith('#'));

await mkdir(outputDir, { recursive: true });
await appendFile(logFile, 'input_url,final_url,http_status,capture_status,screenshot_path,errorn');

const browser = await chromium.launch();
try {
  const page = await browser.newPage();
  page.setDefaultNavigationTimeout(timeoutMs);

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

  for (const [index, inputUrl] of urls.entries()) {
    let response = null;
    let finalUrl = '';
    let screenshotPath = '';
    let captureStatus = 'failed';
    let error = '';

Rank #3
SSK Portable SSD 500GB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 500GB external ssd often appears as around 465GB on Windows. MacOS can show full 500 GB capacity. This is binary calculation difference and doesn’t affect SSD hard drive actual physical storage
  • 1050 MB/s Speed: Instantly access to your files with blazing-fast 10Gbps external SSD read up to 1050MB/s and write up to 1000MB/s. LED Light indicates USB SSD instant activity
  • Data Security: Solid state drives S.M.A.R.T. health diagnostics​ and adaptive TRIM optimizing data block management ensures consistent write speeds and extends the longevity of the portable SSD
  • USB-C & USB-A Cable: Both cables featuring rapid USB 3.2 Gen2, this USB SSD effortlessly bridges devices, enabling seamless cross-platform file transfers and backup between computers, smartphones, tablets and iPhone
  • Always Fast: No slowdowns for large file transfers. With SLC caching (25% of current available capacity allocated as high-speed cache), this external SSD delivers steady 10Gbps for transfers within the cache capacity

    try {
      response = await page.goto(inputUrl, { waitUntil: 'domcontentloaded' });
      finalUrl = page.url();
      screenshotPath = path.join(outputDir, screenshotName(index + 1, inputUrl));
      await page.screenshot({ path: screenshotPath, fullPage });
      captureStatus = 'ok';
    } catch (err) {
      error = err instanceof Error ? err.message : String(err);
      finalUrl = page.url();
      // A navigation can fail after a page has rendered. Try to preserve its visible state.
      if (finalUrl && finalUrl !== 'about:blank') {
        try {
          screenshotPath = path.join(outputDir, screenshotName(index + 1, inputUrl));
          await page.screenshot({ path: screenshotPath, fullPage });
        } catch (shotErr) {
          error += `${error ? ' | ' : ''}Screenshot: ${shotErr instanceof Error ? shotErr.message : String(shotErr)}`;
          screenshotPath = '';
        }
      }
    }

    const row = [inputUrl, finalUrl, response?.status() ?? '', captureStatus, screenshotPath, error].map(csv).join(',') + 'n';
    await appendFile(logFile, row);
    console.log(`${index + 1}/${urls.length}: ${inputUrl} — HTTP ${response?.status() ?? 'none'}, capture ${captureStatus}`);
  }
} finally {
  await browser.close();
}

4. Run it

node bulk-screenshot.mjs urls.txt

By default, this saves viewport screenshots as PNG files in screenshots/ and appends records to results.csv. For full-page captures, run FULL_PAGE=1 node bulk-screenshot.mjs urls.txt. To change the navigation timeout, set TIMEOUT_MS, for example TIMEOUT_MS=60000 node bulk-screenshot.mjs urls.txt.

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

Interpret the log without confusing errors

HTTP response errors

A 4xx or 5xx status is a server response, not necessarily a capture failure. The page may render an error page that is useful to keep. This script logs the response status and attempts the screenshot rather than treating HTTP status alone as a reason to stop.

Navigation and network failures

A DNS failure, connection problem, or timeout can prevent the browser from receiving a main-document response. In that case, http_status is blank, and the error column records the exception. A screenshot may still be possible if the browser has rendered a page before navigation failed; the script makes a best-effort attempt.

Redirects

The input and final URL are logged independently. The status returned by page.goto() refers to the final main-document response, not a list of every redirect hop. If you need a redirect-by-redirect audit, capture and log the navigation response chain separately.

Rank #4
Sale
Sandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model
  • NEARLY 2X FASTER THAN OUR PREVIOUS GENERATION(8) – move 1,000 high-res photos in under 60 seconds(6) with up to 2000MB/s transfer speeds(2).
  • IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.
  • POCKET-SIZED – fits easily in pockets and small bags.
  • SPACE TO OWN YOUR AI CONTENT – speed and capacity to download your high-res clips and photo edits.
  • 256-BIT AES ENCRYPTION(4) – helps keep private files secure with password protection.

Choose capture and readiness settings

Viewport or full page

  • Viewport: a faster, consistent snapshot of the initially visible area.
  • Full page: captures the scrollable page and can produce much larger images. Use it when the entire document matters.

Playwright documents full-page capture as an option in its screenshot API: https://playwright.dev/docs/screenshots.

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

Dynamic content and lazy loading

The script uses domcontentloaded as a repeatable baseline, not a guarantee that every site’s application data, images, or animations are ready. For a known application, wait for a meaningful selector or add a deliberate delay before the screenshot. Check representative captures: no single wait condition is established as correct for every site. Lazy-loaded imagery may require scrolling or site-specific readiness handling before taking a full-page capture.

Cookies, overlays, and authentication

Consent dialogs, chat widgets, newsletter popups, and login walls can appear in the captured image. Authenticated pages require a deliberate authentication setup, such as loading the required session state or supplying credentials through an appropriate secure process. Do not place secrets in a public URL list or commit them to source control.

Make batch runs safer and easier to review

  • Keep filenames unique: the sequence prefix prevents repeated paths from overwriting earlier captures; the host and sanitized path make files easier to identify.
  • Write incrementally: appending each completed row preserves prior results if a later URL fails or the process is interrupted.
  • Keep the input list: retaining the original URL alongside the final URL makes redirects and bad inputs diagnosable.
  • Plan disk use: full-page images can be much larger than viewport images. Make sure the output directory has room, and use a retention policy if runs are frequent.
  • Manage concurrency deliberately: this example processes one page at a time, which is simple and avoids a sudden burst of browser traffic. Add parallel workers only when the target sites, machine, and rate limits can handle them.

When a command-line batch tool fits

shot-scraper documentation describes multi-URL screenshot workflows and a --fail-on-error option. That can suit repeatable shell or scheduled jobs. Its documentation also advises HAR ZIP output for larger runs, rather than oversized JSON HAR output that could cause Playwright to crash. Confirm the current command syntax and options in its documentation before building a job around them.

For an HTTP-error audit, verify whether your chosen command-line workflow records the final document status, redirects, screenshot outcome, and exception text as separate fields. A tool’s fail-on-error behavior does not by itself define the log schema you need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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. Its capture flow accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each cleanup step can be disabled. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify page verdict and billing status in headers. The service supports PNG, JPEG, WebP, or PDF captures.

For a simple API capture, substitute your target URL and API key in this cURL request. See the ScreenshotNeo API documentation for request parameters and response handling.

Best Value
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

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

ScreenshotNeo can be used for individual captures or broader workflows, but this one-call example does not create the per-URL CSV log shown in the Playwright section; build that logging layer if your audit requires it. It also provides take_screenshot, get_page_info, and capture_pdf tools through an MCP server for Claude, Cursor, or any MCP client. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Every feature is on every plan. Learn more at ScreenshotNeo.

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

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Troubleshooting common failures

  • Browser executable missing: run npx playwright install chromium after installing the package.
  • Timeouts on slow pages: increase TIMEOUT_MS or set a site-specific readiness condition. A longer timeout can increase total batch duration.
  • Blank screenshot despite a successful response: the page may render content after domcontentloaded, require interaction, or depend on scripts or authentication. Wait for a meaningful element and inspect a sample capture.
  • HTTP status is blank: navigation may have failed before a main-document response was received, or the URL may be invalid. Review the exception and input URL; do not label this as HTTP 200.
  • Screenshot path is empty: the browser did not save an image. Check the recorded error and filesystem permissions or available disk space.
  • Rows appear repeated after reruns: the script appends to results.csv. Move or remove the old log before a fresh run if you want a new report; keep it if you want an ongoing history.
  • CSV parsing breaks on commas or quotes: use a CSV-aware reader. The script quotes fields and doubles embedded quotation marks.

Frequently asked questions

Does a 404 stop the screenshot?

No. The script records the final response status and attempts a screenshot even when the response is 404 or another HTTP error.

Does the CSV include every redirect status?

No. It records the final main-document status and final URL. Logging every redirect hop requires collecting the response chain separately.

Can I use JSON instead of CSV?

Yes. Keep the same per-URL fields and append one JSON object per line (JSONL) after each result. JSONL is convenient when error text contains commas or when the log will be processed programmatically.

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

Quick Recap

Bestseller No. 2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
From Sandisk, a brand professional photographers trust to take on assignments.
$188.90
SaleBestseller No. 4
Sandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model
Sandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model
IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.; POCKET-SIZED – fits easily in pockets and small bags.
$249.99
SaleBestseller No. 5
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99

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