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

Use Playwright to visit each URL and save its screenshot, then use a scheduler such as GitHub Actions to run the script at the times you choose. Playwright handles the browser work; the scheduler starts it. The example below captures URLs sequentially, records per-URL failures, and saves timestamped image files.

Build a Playwright script to capture several URLs

This Node.js example uses one browser page at a time. Sequential capture is straightforward and uses fewer browser resources than opening several pages concurrently. It saves viewport screenshots by default; set FULL_PAGE=true to capture the full scrollable document.

1. Create the project and install Playwright

  1. Create a project directory and initialize it: npm init -y.

  2. Install Playwright: npm install playwright.

  3. Install a browser: npx playwright install chromium. In CI, install required system dependencies as well; Playwright’s CI guidance uses npx playwright install --with-deps.Playwright CI guidance

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    #1 Best Overall
    Sale
    Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
    • Compatible with Nintendo Switch 2’s new GameChat mode
    • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
    • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
    • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
    • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
  4. Save the following as capture.js.

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

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

function safeHost(url) {
  return new URL(url).hostname.replace(/[^a-z0-9.-]/gi, '_');
}

function timestamp() {
  return new Date().toISOString().replace(/[:.]/g, '-');
}

(async () => {
  const outputDir = path.join(__dirname, 'screenshots');
  await fs.mkdir(outputDir, { recursive: true });
  const browser = await chromium.launch({ headless: true });
  const failures = [];

  try {
    const page = await browser.newPage();
    for (const url of urls) {
      const outputPath = path.join(
        outputDir,
        `${safeHost(url)}-${timestamp()}.png`
      );
      try {
        const response = await page.goto(url, {
          waitUntil: 'load',
          timeout: 30000,
        });
        if (response && !response.ok()) {
          throw new Error(`HTTP ${response.status()} ${response.statusText()}`);
        }
        await page.screenshot({
          path: outputPath,
          fullPage: process.env.FULL_PAGE === 'true',
        });
        console.log(`Saved ${url} to ${outputPath}`);
      } catch (error) {
        failures.push({ url, error: error.message });
        console.error(`Failed ${url}: ${error.message}`);
      }
    }
  } finally {
    await browser.close();
  }

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

The host-and-time filename pattern is an implementation choice, not a Playwright requirement. The timestamp is generated for each capture, so a long run can produce slightly different timestamps for different URLs. If you need all files to share one run timestamp, calculate it once before the loop and reuse it.

2. Choose navigation and screenshot behavior

  • page.goto(url) navigates the page; page.screenshot({ path }) writes the image. The example uses waitUntil: 'load' and a 30-second navigation timeout. Adjust the timeout to fit the sites you capture.Playwright Page API

  • The default screenshot is the current viewport. fullPage: true captures the full scrollable page. Full-page captures can take longer and create larger files.

  • The HTTP status check records non-success responses as failures. Some sites render useful pages with non-2xx responses; remove or customize that check if those should still be captured.

    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.
  • Each URL has its own try/catch, so an unavailable site does not stop later captures. The script sets a failing process exit code if any URL failed, which helps CI report an unsuccessful run while retaining successful screenshots.

    Rank #2
    Sale
    Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
    • Compatible with Nintendo Switch 2’s new GameChat mode
    • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
    • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
    • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
    • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Run the script on a schedule with GitHub Actions

GitHub Actions can trigger the capture command using a scheduled workflow. Create .github/workflows/screenshots.yml in your repository:

name: Scheduled screenshots

on:
  schedule:
    - cron: '17 9 * * *'
  workflow_dispatch:

jobs:
  capture:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright install --with-deps chromium
      - run: node capture.js
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: screenshots
          path: screenshots/
          if-no-files-found: ignore

The example runs daily at 09:17 UTC. GitHub documents scheduled workflow cron expressions, UTC as the default timezone, IANA timezone support, a five-minute minimum interval, and that scheduled workflows run on the default branch. Confirm current behavior in GitHub’s schedule event documentation, especially if using timezone configuration.

A schedule is a trigger, not a precise appointment. GitHub warns that scheduled runs may be delayed at high load, particularly near the start of an hour, and queued runs can be dropped. Choosing a minute away from the hour boundary can avoid that peak, but does not guarantee exact timing. The workflow above uploads the output as an artifact so the generated files are available from the run rather than relying on the temporary runner filesystem.

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

Adjust schedule and output retention

  • Change the cron expression to the desired cadence. The expression 17 9 * * * means 09:17 every day in the configured timezone.

  • To capture full pages in this workflow, change the run command to FULL_PAGE=true node capture.js.

    Rank #3
    Sale
    NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
    • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
    • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
    • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
    • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
    • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • Artifacts are tied to workflow runs. If you need durable storage or a retention period suitable for an archive, add a storage destination or adjust artifact settings to match that need.

  • If the workflow uses a non-default branch, remember that the schedule still follows GitHub’s documented default-branch behavior; merge the workflow and script to that branch accordingly.

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

Choose sequential or multiple-page capture

The script reuses one page and visits URLs in sequence, minimizing browser resource use. If capture time matters more than resource use, you can create multiple pages in a browser context. Playwright supports multiple pages in a context; it does not prescribe a concurrency level for this workload.Playwright pages documentation

const context = await browser.newContext();
const pages = await Promise.all(urls.map(() => context.newPage()));
const results = await Promise.all(
  urls.map(async (url, index) => {
    const page = pages[index];
    try {
      await page.goto(url, { waitUntil: 'load', timeout: 30000 });
      const outputPath = path.join(
        outputDir,
        `${safeHost(url)}-${timestamp()}.png`
      );
      await page.screenshot({ path: outputPath });
      return { url, outputPath };
    } catch (error) {
      return { url, error: error.message };
    }
  })
);
await context.close();
console.log(results);

Concurrent pages can increase memory, CPU, and network demand, especially when pages are heavy. Start with sequential capture; increase concurrency only after observing that the runner has enough resources. In CI, Playwright recommends setting workers to one for stability and reproducibility; that guidance concerns Playwright Test workers, not a fixed limit on pages created by a custom script.Playwright CI guidance

Make recurring screenshots comparable

A saved image is a record of what the browser rendered at that moment, not necessarily a stable visual baseline. Playwright notes that host operating system, browser version, settings, hardware, power source, and headless mode can affect rendering. For meaningful visual comparisons, use the same environment as the baseline and keep those variables stable.Playwright visual comparisons

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

If the purpose is visual regression testing rather than periodic archiving, use Playwright Test’s expect(page).toHaveScreenshot(). Screenshot assertions wait for two consecutive screenshots to match before comparing against a baseline, and they work with the Playwright test runner. They are a testing workflow, distinct from simply saving timestamped screenshots.

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

Troubleshoot failed scheduled captures

  • Browser executable is missing: install Chromium locally with npx playwright install chromium; in CI use npx playwright install --with-deps chromium so browser and system dependencies are present.

  • Navigation times out: the page may be slow, blocked, or waiting on resources. Increase the timeout for genuinely slow pages, check the runner’s network access, or choose an appropriate readiness condition. Do not assume that a longer timeout fixes a site that actively blocks automation.

  • A screenshot is blank or incomplete: the page may render content after the load event, or defer images until scrolling. Consider waiting for a relevant selector or a suitable delay before capturing. For lazy-loaded full-page content, test the site behavior; a full-page screenshot option alone does not guarantee every site has loaded deferred assets.

  • Some URLs fail while others succeed: inspect the logged URL-specific errors and HTTP status. The script continues through the list and returns a nonzero result if any capture failed.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    Best Value
    Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
    • Compatible with Nintendo Switch 2’s new GameChat mode
    • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
    • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
    • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
    • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
  • The workflow appears late or did not run at the expected minute: scheduled Actions runs can be delayed or dropped under high load. GitHub cron is not a precision scheduler; use another scheduling system if a strict execution time is essential.

  • Images differ from previous captures: stabilize browser version, operating system, headless settings, and runner environment, and account for dynamic page content such as timestamps or rotating promotions.

  • No screenshots appear in the workflow run: confirm the script writes to the screenshots/ directory and inspect the job logs. The artifact upload step uses if: always() so outputs can be retained even when a capture fails.

Or skip the browser setup

ScreenshotNeo can capture a URL with one GET request, returning an image or PDF. Its API removes cookie and consent banners, newsletter popups, and chat widgets before the shot; those cleanup steps can also be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. An MCP server provides screenshot tools for AI agents, including Claude and Cursor. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. See the API documentation.

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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Schedule that command with the same CI workflow approach, replacing node capture.js with the command and managing the API key as a secret. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Can Playwright take screenshots of several URLs in parallel?

Yes. Create multiple pages in a browser context and navigate them concurrently; the example above shows this pattern. Keep concurrency within the runner’s available resources.

Does GitHub Actions guarantee a scheduled run at an exact time?

No. Scheduled workflows can be delayed during periods of high Actions load, and some queued jobs can be dropped.

Can I use these screenshots for visual regression testing?

For baseline comparisons, use Playwright Test’s screenshot assertion, expect(page).toHaveScreenshot(), rather than treating periodic image files as test baselines.

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

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.72
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.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.