October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Redmond desk5 min

How to Capture Multiple Website URLs as Screenshots with Playwright on Windows

A practical Windows guide to installing Playwright, capturing a list of URLs with unique screenshot files, and choosing viewport, full-page, format, and readiness settings.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a Node.js script with Playwright: install the package and its matching browser binaries, put the URLs in an array, then loop through them and save each page to a unique screenshot file. The example below runs captures sequentially in one browser context, uses a consistent viewport, and closes pages and the browser even if a capture fails.

Set up Playwright on Windows

  1. Install a supported Node.js release. Playwright’s current installation documentation lists Node.js 22.x, 24.x, or 26.x and Windows 11 or Windows Server 2019 or later (also WSL). Because that is a /next/ documentation page and runtime requirements can change, confirm the current requirements before installation.

    As an Amazon Associate I earn from qualifying purchases.

  2. Open PowerShell and create a project directory:

    mkdir website-screenshots
    cd website-screenshots
    npm init -y
  3. Install Playwright and its browser binaries:

    npm install playwright
    npx playwright install

    The npm package alone is not enough; Playwright also needs its browser binaries. On Windows, the documented browser cache is %USERPROFILE%AppDataLocalms-playwright. If you update Playwright, run npx playwright install again so the browser binaries match the installed package version. See the browser installation guide.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. Create the output folder and a script file:

    mkdir screenshots
    notepad capture.js

    Paste the code in the next section into capture.js, save it, and run node capture.js from the project directory.

    #1 Best Overall

Capture a list of URLs sequentially

This complete example creates one browser context with a fixed viewport, opens a fresh page for each URL, saves a full-page PNG with a numbered filename, and closes resources in finally blocks. Create the screenshots directory before running it as shown above.

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

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

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

  try {
    for (const [index, url] of urls.entries()) {
      const page = await context.newPage();
      try {
        await page.goto(url, { waitUntil: 'load' });
        await page.screenshot({
          path: path.resolve(
            `screenshots/site-${String(index + 1).padStart(3, '0')}.png`
          ),
          fullPage: true,
        });
      } finally {
        await page.close();
      }
    }
  } finally {
    await context.close();
    await browser.close();
  }
})();

Run it with node capture.js. It writes site-001.png, site-002.png, and so on in the screenshots folder. The sequential loop is intentionally straightforward: it makes failures easier to associate with a URL and avoids starting a large number of pages at once.

Choose what each screenshot captures

Viewport or full page

By default, a screenshot captures the visible viewport. Set fullPage: true to capture the full scrollable page. Full-page images can be much taller and larger than viewport images; some sites also load content only after scrolling, so check whether the page’s lazy-loaded content appears as intended. The Page API documents the screenshot options.

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

Image format and pixel scale

Playwright infers the output image type from the file extension. The screenshot API supports PNG, JPEG, and WebP; use a matching extension such as .png, .jpg, or .webp. The default scale is CSS, which produces one image pixel per CSS pixel. Device scale follows the device pixel ratio and may produce larger images. Choose a format and scale consistently if you plan to compare or archive captures.

Viewport consistency

The context’s viewport setting controls the page dimensions used in this example. Reusing one context carries the same context-level settings across its pages; Playwright’s Pages guide notes that a browser context can contain multiple pages. See Pages. Use a new context only when a particular URL needs different cookies, emulation, or other context-level settings.

Handle pages that are not ready at the load event

waitUntil: 'load' waits for the page load event, but it does not guarantee that every site-specific widget, client-rendered section, or delayed image has finished appearing. If a target page needs more time or a specific element, change the readiness condition for that site rather than adding an arbitrary long delay to every URL.

Playwright’s rendering may differ across host operating systems, browser versions, settings, hardware, power source, and headless mode. For repeatable visual comparisons, keep those conditions and your viewport, scale, and capture options fixed; consult Playwright’s visual comparisons guidance.

Troubleshooting common failures

  • Playwright cannot find its browser executable: the package may be installed without its browser binaries, or the package may have been updated since they were installed. Run npx playwright install from the project directory.

    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.
  • The script cannot write screenshots: confirm that the screenshots folder exists and that the process has permission to write there. The example deliberately does not create the folder automatically.

  • A navigation times out or fails: check the URL and network access, then determine whether the page is slow or requires a different readiness condition. Avoid treating a successful load event as proof that all dynamic content is ready.

  • The image is only the visible screen: confirm that the screenshot call includes fullPage: true. Without it, Playwright captures the viewport.

    Rank #3
    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.
  • Images differ between runs or machines: rendering can vary with the operating system, browser version, hardware, settings, and headless mode. Keep the environment stable and compare captures made with the same dimensions and scale.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • One bad URL stops the batch: the finally blocks close the current page and browser resources, but this minimal script allows a navigation error to stop later URLs. To continue after an individual failure, add a per-URL catch around navigation and screenshot saving, log the URL and error, and leave the outer cleanup in place.

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: a GET request with a URL returns a PNG, JPEG, WebP, or PDF. It removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents and other MCP clients take screenshots, and it offers 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000.

For a single request from PowerShell, replace the target URL and API key in this cURL example. See the ScreenshotNeo API documentation for parameters and response details.

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

Sign up for ScreenshotNeo’s free plan to get 1,000 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

Can one Playwright browser context capture several URLs?

Yes. A browser context can contain multiple pages, so the script can create and close a page for each URL while reusing the same context settings.

Does Playwright save screenshots as PNG only?

No. The screenshot API supports PNG, JPEG, and WebP; the output file extension determines the image type.

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
$245.99
Bestseller No. 2
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.
$285.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.

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.