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

Put the URLs in an array, visit them in a loop, and save each page with page.screenshot({ path, type: 'png' }). Give every URL a distinct output filename; choose a viewport capture for a consistent visible area or fullPage: true to include the full scrollable page. The JavaScript example below processes URLs sequentially and records each navigation response status.

Set up a Playwright batch screenshot script

This Node.js example uses Playwright’s Chromium browser. It creates the output folder, validates that each input is an HTTP or HTTPS URL, captures each page as a PNG, and continues to the next URL if one capture fails.

Install Playwright and its Chromium browser in your project:

npm install playwright
npx playwright install chromium

Save the following as batch-screenshots.js:

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

const urls = [
  'https://example.com',
  'https://playwright.dev',
];

async function main() {
  const outputDir = path.resolve('screenshots');
  await fs.mkdir(outputDir, { recursive: true });

  const browser = await chromium.launch();
  const context = await browser.newContext({
    viewport: { width: 1440, height: 900 },
  });

  try {
    for (const [index, rawUrl] of urls.entries()) {
      const outputPath = path.join(
        outputDir,
        `${String(index + 1).padStart(3, '0')}.png`
      );

      let page;
      try {
        const parsed = new URL(rawUrl);
        if (!['http:', 'https:'].includes(parsed.protocol)) {
          throw new Error('URL must use http or https');
        }

        page = await context.newPage();
        const response = await page.goto(rawUrl, { timeout: 30_000 });
        const status = response?.status() ?? null;

        await page.screenshot({
          path: outputPath,
          type: 'png',
          fullPage: true,
        });

        console.log({ url: rawUrl, status, outputPath, result: 'saved' });
      } catch (error) {
        console.error({
          url: rawUrl,
          outputPath,
          result: 'failed',
          error: error.message,
        });
      } finally {
        if (page) await page.close();
      }
    }
  } finally {
    await context.close();
    await browser.close();
  }
}

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

Run it with node batch-screenshots.js. The files will be written to a screenshots directory beside the script. The numbered names are unique within this run and avoid unsafe characters from URLs. If you want filenames to identify URLs, create a sanitizing and collision-handling scheme; query strings can contain sensitive values, so do not blindly put raw URLs in filenames.

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

The example is an implementation pattern, not a claim that every site will render identically or successfully. Add logging or persistent result storage if you need a durable record of outcomes.

Choose what each PNG contains

Capture the visible viewport

For a same-sized image of the page’s initial view, leave out fullPage or set it to false. The viewport dimensions come from the context’s viewport setting; the example uses 1440 by 900 pixels. This is useful when comparing page headers or capturing a consistent screen area.

Capture the full scrollable page

Set fullPage: true to capture beyond the visible viewport. Playwright’s Page API describes this as taking a screenshot of “the full scrollable page, instead of the currently visible viewport” (Playwright Page API). Long pages can create very tall images, so check whether your image viewer, storage system, or downstream processing can handle the resulting dimensions and file size.

Keep PNG output explicit

When a screenshot is saved to a path, Playwright can infer its format from the filename extension. The script also sets type: 'png' so the intended format is explicit. Playwright supports PNG, JPEG, and WebP; the documented quality option does not apply to PNG. See the Page API options for the current screenshot parameters.

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.
Rank #2
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
  • 1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core
  • 4GB DDR4 System Memory; 128GB Solid State Drive
  • 11.6" HD (1366 x 768) Multi-Touch Display
  • Combo headphone/microphone jack - Noble Wedge Lock slot - HDMI; 2 USB 3.1 Gen 1
  • Windows 11 Pro

Make the batch reliable

Check HTTP status separately from navigation errors

page.goto() may return a response with an HTTP error status such as 404 or 500 without throwing solely because of that status. The example logs the response status but still saves the page. If your batch should treat certain statuses as failures, apply that policy explicitly after reading response.status(); a missing response is recorded as null.

Decide when a page is ready to capture

A completed navigation does not guarantee that every page’s client-side data, delayed images, fonts, animations, or widgets have settled. Choose a readiness signal based on the site—for example, wait for a selector that is meaningful for the content you need. There is no single wait condition that guarantees visual readiness for every arbitrary website. A fixed delay may help with a known site, but can waste time or still be too short.

Handle failures per URL

Keep each URL’s navigation and screenshot inside its own error handler so one timeout, DNS or TLS problem, invalid URL, or site-side block does not stop later entries. Record the URL, status when available, path, and error. The example logs failures to the console; production jobs may need a JSON or database report and a deliberate retry policy.

Use unique paths and protect sensitive inputs

Index-based names such as 001.png make it straightforward to avoid collisions in a single batch. If multiple runs write to the same directory, include a run identifier or otherwise ensure that one run cannot overwrite another. URL-derived names need sanitization and disambiguation. Avoid exposing tokens or other sensitive query parameters in filenames or logs.

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.
Rank #3
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

Scale beyond a sequential loop

The sample intentionally processes one page at a time. This is easier to reason about and limits simultaneous browser work. A browser context can host multiple pages, and pages share context-level settings such as viewport and locale (Playwright Pages guide), but Playwright does not prescribe a universally ideal concurrency level for arbitrary batches.

If a sequential run is too slow, use a bounded worker pool rather than launching every URL at once. Pick a small concurrency limit, observe memory use, timeouts, target-site behavior, and output throughput, then adjust for your workload. Respect site policies and avoid creating load the destination cannot handle. If URLs need different viewport, locale, or other context-level configuration, group them by configuration or create separate contexts instead of assuming one context setting can vary per page.

Save screenshots in memory instead of to disk

If the next step uploads, transforms, or inspects the image, omit path and use the screenshot call’s returned buffer. The Playwright screenshot API documents that a screenshot can return image bytes without writing a file (Playwright Screenshots guide). That URL is on Playwright’s next documentation channel and may change. Your application can then pass the buffer to its own storage or image-processing code.

Make captures repeatable

For visual comparisons or repeatable archives, keep the operating system, browser version, browser settings, hardware, power source, and headless mode as consistent as possible. Playwright notes that these factors can change screenshot output and advises using the same environment as the baseline capture (Visual comparisons guide). A live page may also change over time even when the automation stays the same.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
15.6 Inch Laptop Computer, N4020, 4GB DDR4 RAM, 128GB eMMC,with Windows 11
  • EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
  • 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
  • RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
  • ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
  • LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.

Or skip the browser setup

ScreenshotNeo can capture a URL with one API request instead of running a browser locally. It accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response includes X-Page-Verdict and X-Billed headers.

Use this cURL request, replacing the example URL and adding your API key. See the ScreenshotNeo API documentation for request options.

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

ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Its Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.

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

Troubleshooting

The script cannot find the Playwright package or browser

Run npm install playwright in the project directory and install Chromium with npx playwright install chromium. Ensure you run the script from the project where the package is installed.

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

A URL fails while the rest should continue

Check that it includes an http:// or https:// scheme and is reachable from the machine running the script. Inspect the logged error for timeout, DNS, TLS, or site-side blocking. The per-URL try/catch keeps later URLs running; choose a retry policy only after deciding which errors are likely transient.

Best Value
Sale
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.

A PNG exists but shows an error page

Inspect the logged HTTP status. A 404 or 500 response can still produce a page that Playwright screenshots. Decide whether to retain error pages for diagnostics or mark them as failed based on your status rules.

The screenshot misses content or looks inconsistent

Verify the viewport or fullPage setting, then wait for a site-specific readiness condition if content loads after navigation. For comparison work, keep the browser and machine environment consistent; the site itself may also have changed.

Files overwrite or have unusable names

Use a unique index or run-specific name rather than a raw URL. If names are derived from URLs, sanitize characters, handle collisions, and avoid including secrets from query strings.

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

Frequently Asked Questions

Can one Playwright browser context handle several URLs?

Yes. A context can host multiple pages, which act like separate tabs and share context-level settings. The sample uses one page at a time for predictable sequential processing.

Can I capture an element instead of a whole page?

Yes. Playwright supports element screenshots; locate the desired element and use its screenshot method. See the screenshot examples at https://playwright.dev/docs/next/screenshots.

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$249.99
Bestseller No. 2
Dell Latitude 3190 11.6' HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core; 4GB DDR4 System Memory; 128GB Solid State Drive
$179.99
Bestseller No. 3
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$304.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.