Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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 Now×
Skip to content
World desk8 min

How to Run a Scheduled Playwright Screenshot Job in Docker

Use a version-matched Playwright Docker image and a small capture script to automate screenshots with GitHub Actions or a self-managed scheduler.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run a scheduled screenshot as a short-lived Docker job: keep a Playwright script and lockfile in your repository, use a Playwright container image that matches the installed package version, save screenshots to a known directory, and let a scheduler start the container. On GitHub Actions, upload that directory as a workflow artifact; on a self-managed host, mount it to durable storage. The steps below cover both approaches, version pinning, timing limits, troubleshooting, and security.

How the scheduled job fits together

The Playwright Docker image includes browser binaries and operating-system browser dependencies, but it does not include your project’s Playwright package. Install the package from the lockfile during the job, and align its release with the image tag so Playwright can find the browser executables. Keep the script, package manifest, and lockfile in your repository.

As an Amazon Associate I earn from qualifying purchases.

  1. Write a script that opens the target URL and saves the screenshot in a known output directory.
  2. Run it in a short-lived container using the matching Playwright image and package versions.
  3. Schedule the container through GitHub Actions or a host scheduler.
  4. Persist the output by uploading it as an artifact or mounting a durable storage location.

Create the capture script

This Node.js example uses Playwright’s browser API, not the Playwright Test runner. It reads the target URL from an environment variable, creates the output directory, waits for network idle, and captures the full page. Save it as screenshot.mjs:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { chromium } from 'playwright';
import { mkdir } from 'node:fs/promises';

const url = process.env.TARGET_URL;
if (!url) throw new Error('Set TARGET_URL');

const outputDir = process.env.OUTPUT_DIR ?? 'screenshots';
await mkdir(outputDir, { recursive: true });

const browser = await chromium.launch();
try {
  const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
  await page.goto(url, { waitUntil: 'networkidle', timeout: 60_000 });
  await page.screenshot({ path: `${outputDir}/page.png`, fullPage: true });
} finally {
  await browser.close();
}

Use a stable filename if each run should replace the previous capture. If you need a history, add a UTC timestamp to the filename and configure retention or storage accordingly. Playwright’s screenshot API also supports format, quality, and clipped regions; choose those options when the output needs them.

A compact package.json can expose a consistent job command. Replace the explanatory version marker with an exact Playwright version and commit the generated lockfile:

{
  "scripts": {
    "screenshot": "node screenshot.mjs"
  },
  "dependencies": {
    "playwright": "<exact-version-matching-the-image>"
  }
}

The version marker above is not a valid version to install: set an exact release in your project and use the corresponding release in the image tag. Then npm ci installs from the lockfile reproducibly.

Schedule it with GitHub Actions

Create .github/workflows/screenshot.yml. This sample runs daily at 17:23 UTC and can also be started manually. Replace the example target URL and image version. Action major versions, Node version, image tag, and artifact retention are example values; verify they remain supported for your repository and project.

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

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

jobs:
  capture:
    runs-on: ubuntu-latest
    container:
      # Use the same Playwright release as package.json.
      image: mcr.microsoft.com/playwright:v<matching-version>-noble
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: '22'
      - run: npm ci
      - run: npm run screenshot
        env:
          TARGET_URL: https://example.com
          OUTPUT_DIR: screenshots
      - uses: actions/upload-artifact@v5
        if: ${{ !cancelled() }}
        with:
          name: scheduled-screenshots
          path: screenshots/
          retention-days: 14

The matching image tag must be a real release tag, not the illustrative marker in the YAML. If npm ci needs a different Node release, select one compatible with the project and lockfile. Playwright’s CI guide documents container jobs, browser dependencies, and artifact workflows: Playwright CI documentation.

Rank #2
Sale
GMKtec G3S Mini PC Intel N95 Processor (Up to 3.4GHz) 8GB RAM 256GB M.2 SSD | Mini Desktop Computer with VESA Mount for Office Home Business HTPC Proxmox, Dual 4K Display, WiFi 5, Gigabit Ethernet
  • 12th Intel Alder Lake N95 Processor – The GMKtec G3 S Mini PC is powered by the 12th Gen Intel N95 processor with 4 cores, 4 threads, 6MB cache and a burst frequency up to 3.4GHz. Compared with N100/N5105/N5100/N5095, the N95 delivers up to 36% overall performance improvement. Perfect for routine tasks, office work, and home entertainment, this compact mini desktop is more convenient than traditional bulky PCs.
  • 8GB RAM & 256GB SSD Storage – Pre-installed with 8GB DDR4 memory and a fast 256GB M.2 2242 SSD, the G3 S mini desktop offers quicker startup, smoother multitasking, and faster file transfers. Enjoy seamless performance whether you’re working on multiple applications, browsing, or streaming content.
  • Rich Interfaces & Connectivity – The G3 S mini computer comes equipped with USB 3.2 (up to 10Gbps), dual HDMI 2.0 (4K@60Hz), and a 3.5mm audio jack. With support for WiFi 5, Bluetooth 5.0, and Gigabit Ethernet (RJ45 1000MbE), it connects easily with monitors, projectors, printers, office equipment, and other peripherals, making it versatile for both home and business use.
  • Dual 4K Display Support – Featuring upgraded Intel UHD Graphics (up to 1000MHz), the G3 S supports 4K video playback and AV1 decoding for a smooth viewing experience. With dual HDMI outputs, you can connect two 4K@60Hz displays simultaneously, enabling efficient multitasking for work and entertainment.
  • GMKTEC WARRANTY - GMKtec offers a 3-year limited warranty (1 year replacement + 2 years parts replacement) for each mini PC, starting from the date of the purchase effective on all sales starting Oct. 2026. All defects due to design and workmanship are covered. With a professional after sales team always ready to attend to your needs, you can simply relax and enjoy your mini PC

Choose the schedule with realistic expectations

GitHub scheduled workflows use five-field POSIX cron. UTC is the default, and current GitHub documentation also permits IANA time zones. The minimum documented interval is five minutes, but a scheduled start is not an exact-time guarantee: high load can delay runs, and some queued runs can be dropped. A minute away from the top of the hour can reduce exposure to the documented high-load period. Scheduled workflows run from the latest commit on the default branch, so the workflow file must be present there. Consult GitHub’s schedule event documentation for current behavior.

Retrieve generated screenshots

The upload step stores screenshots/ as a workflow artifact for later retrieval. Artifacts are generated output; dependency caches are for reusable inputs such as packages. Screenshots inside a container or job workspace do not become a durable archive unless you explicitly upload or store them. See GitHub’s artifact documentation for artifact controls and retention.

Run the same job on a self-managed Docker host

On Linux with Docker installed, cron, a systemd timer, or an existing orchestrator can start the same container at your chosen interval. There is no universally correct host scheduler: choose according to your logging, alerting, and persistence setup. Keep the schedule outside the image, pass the URL through environment configuration or a secrets store, mount a writable output directory, and send logs to the host’s logging system.

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

Before scheduling, smoke-test the container from the repository directory. Replace the illustrative image version with the same exact Playwright release used by your dependency:

Rank #3
Sale
ACEMAGIC K1 Mini PC AMD Ryzen 7330U 16GB 256 SSD 4 Cores 8 Threads 4.3GHz | 28W Multitasking, Cooling Mini Computer Win 11 Pro, Beat 3500U/3200U Triple 4K Display, HDMI, LAN, Home Office & Business
  • [AMD Ryzen 3 Pro 7330U, which is more powerful than the N150/3500U] - ACEMAGIC Mini PC is powered by Latest Processor AMD Ryzen 7330U(4Cores/8Threads, BASE 2.3GHz, MAX TO 4.3GHz) , delivers more than 28% higher performance than N150(Reference from PassMark). Performance at least +40%, GPU at least +23% compared with the previous CPU - N95/N100/3300U. Remarkably power-efficient at 28W, it outperforms its predecessors, even rivaling some mainstream mobile processors from the past
  • [K1 Mini Computer - Meet Your Second PC] - Next-Gen Light Office Mini PC comes pre-installed with the Win11 Pro system, which is intelligent, secure, and efficient. Versatile Connectivity: 10M/100M/1000M RJ45 Gigabit Ethernet Port *1, USB3.2 Type-A Port*6, USB3.2 Gen2 Type-C (10Gbps Data Transfer+DP1.4)×1, HDMI 2.0*1, DP 1.4*1, DC IN ×1, 3.5mm Audio Jack*1. All-New Built-in Power Supply devise Only one cable is needed for power supply, no external adapter is required, keep the desktop neat and clean. Whether it’s for business, family entertainment, school, research, or social media, this mini PC has your needs covered!
  • [Large Storage Capacity, Easy Expansion] - Mini Computer K1 is equipped with a 16GB LPDDR4 3200MT/S (non‑expandable memory) and a 256GB M.2 2280 SSD, which allows the small PC to run several high performance operations simultaneously. The LPDDR4 memory delivers faster data transfer speeds for snappier multitasking and responsive performance. The Ryzen micro desktop offers fast data reading, writing, and storage capabilities, ensuring smooth application running. If you want more storage space, you can also add M.2 NVMe PCIe 3.0 SSD or M.2 SATA SSD to expand storage up to 2TB. This means you can easily store and access a large amount of files, media, and data
  • [Sleek Chassis & High efficiency cooling system] - The portable mini pc features a Silver-toned Body and can be stored in a bag and carried with you at any time, ideal for business trips. Save space by super mini size(5x5x1.6 inch) and a VESA mount to install it on wall or monitors. Advanced Axial Fan & Internal Cooling Technology are practically silent at light load and even under load, the fans remain fairly quiet. Minimal or inaudible fan noise is perfect for concentrating on the task at hand!
  • [WiFi 5&Bluetooth 4.2-Simply Compatible]- ACE Win11 Small PC have reliable and stable wireless connection, opening websites in seconds, watching movies without buffering and downloading files smoothly. Built-in Bluetooth enables you to connect multiple wireless devices such as mice, keyboard, headset, monitoring equipment, printer, monitor, TV and so on. High-speed wireless connection technology, reliable and efficient transmission speed, providing a faster internet experience for browsing and streaming
docker run --rm --init --ipc=host 
  -e TARGET_URL=https://example.com 
  -e OUTPUT_DIR=/work/screenshots 
  -v "$PWD:/work" 
  -w /work 
  mcr.microsoft.com/playwright:v<matching-version>-noble 
  sh -lc 'npm ci && npm run screenshot'

The bind mount makes the host’s screenshots/ directory available after the container exits. The --init option helps avoid PID 1 process-handling problems; --ipc=host provides Chromium with more shared memory and helps prevent memory-related crashes. Playwright discusses these container settings in its Docker documentation.

Keep captures reproducible

  • Pin the Playwright package, Docker image, and runtime versions rather than using a floating tag.
  • Compare screenshots only when operating system, browser release, settings, hardware, power source, and headless mode are alike. Differences in these conditions can change rendered pixels.
  • For CI suites, Playwright recommends one worker when stability and reproducibility matter. A single capture script may not use test workers, but keep concurrency controlled if the job grows into a suite.
  • Playwright generally does not recommend browser caching in CI: restoring a cache can take as long as downloading browser binaries, and Linux operating-system dependencies cannot be cached.

These recommendations and rendering caveats are covered in the Playwright CI documentation and visual comparison documentation.

Secure the target and container

Playwright describes its Docker image as intended for testing and development, and does not recommend using it to visit untrusted websites. The image runs as root by default, which disables Chromium’s sandbox. For scraping or crawling scenarios, Playwright’s Docker guidance recommends a separate user and a seccomp profile. Treat arbitrary target URLs as a security boundary: do not expose secrets unnecessarily, isolate credentials, and apply container hardening appropriate to your threat model.

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

Troubleshoot common failures

Symptom Likely cause What to check or change
Playwright cannot find a browser executable or browser launch fails The installed package release and image release do not match, or the project’s package was never installed. Confirm that the package and image use the same release, and run npm ci in the job. Set DEBUG=pw:browser to enable browser launch diagnostics.
Chromium crashes or reports insufficient shared memory The container does not have adequate shared memory. Try the documented --ipc=host setting for a container you control, then inspect host memory and container limits.
The workflow finishes but no image is available The capture failed before writing, the output path differs from the artifact path, or files were left only inside a removed container. Check the job logs, verify OUTPUT_DIR and the upload or mount path agree, and confirm the script writes the expected filename.
The screenshot is blank or captures the wrong state The page may not have reached the state the script expects, or the page’s rendering depends on timing or external resources. Inspect the page in the same environment, review navigation errors and timeouts, and consider waiting for a specific selector or a deliberate delay rather than relying only on network idle.
A scheduled run starts late or does not appear GitHub schedule starts can be delayed during high load, and queued runs may be dropped. Check workflow run history and use manual workflow_dispatch for an immediate run. Do not treat cron as a precise-time trigger.
npm ci fails The lockfile may not match package.json, or the selected Node runtime may be incompatible with the project. Regenerate and commit the lockfile with the intended dependencies, then choose a compatible Node version.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

DIY Docker versus a hosted schedule

The choice is mainly about operational control and where output should live; the capture script can remain the same.

Rank #4
BOSGAME E5 11 Pro Mini PC, AMD Ryzen 5300U 4C/ 8T, Business Home Office PC | 8GB DDR4 256GB M.2 2280 SSD, 2.5 GbE Dual Lan Desktop Computers, Triple Displays 4K 60Hz, Wi-Fi 5, BT 5.0, Support Linux SSH
  • 【AMD Ryzen 3 5300U CPU: Outperforms N150 & 3500U】 BOSGAME E5 mini PC is powered by the TSMC 7nm FinFET architecture AMD Ryzen 3 5300U processor (4 Cores, 8 Threads, up to 3.8GHz boost, 6MB total cache). Compared to low-end Intel N150 or 3500U chips which only have 4 single threads and throttle under load, the 5300U delivers over 30% faster multi-core speed. Run 30+ browser tabs, large Excel sheets, and Zoom meetings simultaneously without system lag.
  • 【8GB DDR4 RAM & 256GB NVMe SSD Storage】 Installed with high-speed 8GB DDR4 dual-channel memory and a fast 256GB M.2 2280 SSD, eliminating slow boot times and application loading delays. To accommodate growing data requirements, the upgradeable hardware design features dual SODIMM slots that allow you to expand memory up to 64GB RAM, ensuring smooth operation during heavy multitasking.
  • 【High-Capacity Dual M.2 SSD Storage Expansion】 Never worry about running out of space for your business files. In addition to the pre-installed 256GB system drive, the motherboard houses an extra empty internal M.2 2280 NVMe PCIe 3.0 slot. This allows you to easily add a second solid-state drive for up to an additional 2TB of storage capacity (upgrades not included) without needing to remove or reinstall the original operating system.
  • 【Radeon 6-Core Graphics & Triple 4K Displays】 Integrated with official AMD Radeon Graphics (6 Graphics Cores, 1500 MHz frequency) for casual gaming, photo editing, and crisp 4K media decoding. Featuring 1x HDMI 2.0 port, 1x DisplayPort, and 1x Full-Function Type-C port, the E5 outputs true 4K@60Hz resolution to three monitors at once. This multi-screen setup eliminates constant window-switching for traders, programmers, and office workers.
  • 【Dual 2.5GbE LAN Ports for Advanced Networking】 Experience fast wired network transmission speeds up to 2500Mbps without lagging or buffering. The integration of dual 2.5 Gigabit Ethernet ports (powered by Realtek RTL8125 controller) makes this compact computer an exceptional hardware choice for tech enthusiasts. Easily configure it into software routers, hardware firewalls (pfSense, OpnSense), home NAS servers, or local homelabs.
Decision GitHub Actions Self-managed container
Scheduler Workflow cron with UTC default and documented IANA timezone support. Host scheduler or orchestrator, selected for the host environment.
Output Upload workflow artifacts for retrieval after the run. Mount a host directory or configure durable storage.
Timing Convenient, but starts may be delayed or dropped at high load. Depends on host availability and operational setup.
Operations Configure workflow, dependencies, and artifact retention. Maintain the Docker host, scheduler, logs, alerts, and storage.
Control Less host maintenance. More control over the host environment, with corresponding maintenance.

Or skip the browser setup

If you need a screenshot endpoint rather than a maintained browser container, ScreenshotNeo returns a screenshot or PDF from one GET request. It accepts cookie banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents.

Example cURL request (see the ScreenshotNeo API documentation for the request options):

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

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.

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.

Frequently Asked Questions

Can I use a cron schedule more frequent than once a day in GitHub Actions?

Yes. GitHub’s documented minimum interval for scheduled workflows is five minutes, though actual starts are not guaranteed at the scheduled minute.

Do I need the Playwright Test runner for one scheduled screenshot?

No. A script using Playwright’s browser API is enough for a single capture; use the test runner if you need a test suite or its reporting features.

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
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver 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.