Halloween 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 NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › GitHub Actions

How to Run a Daily Puppeteer Screenshot Job for Competitor Product Prices

By Freedom251 Team · · 8 min read

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

Use Puppeteer to open each product page at a consistent viewport, wait for that page’s price element to appear, and save a timestamped screenshot. Run the script on a daily schedule, then monitor both failed runs and missing daily records: a scheduled start is not a guarantee that a capture completed on time.

What the daily job should do

Keep target URLs and page-specific price selectors in configuration. For each target, open the page, wait for its price to be visible, save a screenshot with a date and target identifier, and record whether the capture succeeded. Treat a missing price selector or navigation timeout as a failed capture, not as a successful archive.

As an Amazon Associate I earn from qualifying purchases.

Puppeteer’s screenshot guide documents full-page and element screenshots. Its Page API documents viewport settings and selector waits. The code below is a starting point: selectors, permissions, and readiness behavior are specific to each retailer.

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

Configure targets and capture consistently

1. Create a project and install Puppeteer

Use a Node.js project with ES modules enabled, then install Puppeteer:

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

npm init -y
npm pkg set type=module
npm install puppeteer

Save the script below as capture-prices.js. Add only product URLs you are permitted to access. Set priceSelector to a selector that identifies the visible price on that product page; there is no universal retailer selector.

2. Capture one screenshot per target

This example uses a UTC date in each filename, a fixed viewport, a selector wait with a timeout, and browser cleanup in a finally block. It creates a directory per run and logs success or failure per target. A failed target does not prevent the remaining targets from being attempted.

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

import puppeteer from 'puppeteer';
import { mkdir } from 'node:fs/promises';

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

const targets = [
  { id: 'item-a', url: 'https://example.com/product-a', priceSelector: '.product-price' },
  { id: 'item-b', url: 'https://example.com/product-b', priceSelector: '[data-price]' },
];

const runDate = new Date().toISOString().slice(0, 10);
const outputDir = `screenshots/${runDate}`;
await mkdir(outputDir, { recursive: true });

const browser = await puppeteer.launch();
let failures = 0;
try {
  for (const target of targets) {
    const page = await browser.newPage();
    try {
      await page.setViewport({ width: 1280, height: 900 });
      await page.goto(target.url, { waitUntil: 'domcontentloaded', timeout: 30000 });
      await page.waitForSelector(target.priceSelector, { visible: true, timeout: 15000 });
      const screenshotPath = `${outputDir}/${target.id}-${runDate}.png`;
      await page.screenshot({ path: screenshotPath, fullPage: true });
      console.log(JSON.stringify({ target: target.id, status: 'success', screenshotPath }));
    } catch (error) {
      failures += 1;
      console.error(JSON.stringify({ target: target.id, status: 'failed', error: error.message }));
    } finally {
      await page.close();
    }
  }
} finally {
  await browser.close();
}

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.

if (failures > 0) process.exitCode = 1;

Replace the example URLs and selectors before running. The output filename includes the UTC date, so consecutive daily runs do not overwrite one another. If you need multiple captures on the same day, include a timestamp in the filename as well. Save the resulting files somewhere with retention appropriate to your comparison needs; the script uses local disk and does not provide durable off-machine storage.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

3. Choose a readiness condition deliberately

domcontentloaded means the initial document has been parsed; it does not establish that client-rendered product details are ready. Waiting for the displayed price selector is a more relevant check for this job. The 15-second selector timeout is an example setting, not a guarantee that every site will load in that time.

Puppeteer’s screenshot guide also demonstrates waiting for a selector before taking an element screenshot. If the comparison needs only the price region, use page.locator(target.priceSelector).screenshot({ path: screenshotPath }) after the same readiness wait, subject to the Puppeteer version you install. A full-page capture preserves surrounding product context; an element capture is narrower and may omit context such as sale labels or unit pricing.

A fixed delay can help with a known animation or delayed update, but it is less robust than checking the page for the condition you actually need. Network-idle waits can be unsuitable on sites with persistent requests; use them only if they behave reliably for the specific target. Keep the viewport unchanged and set it before navigation, since Puppeteer notes that some sites do not expect layout resizing after navigation.

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

Schedule the job once a day

Use a GitHub Actions scheduled workflow

GitHub Actions supports POSIX cron schedules. Scheduled workflows run on the repository’s default branch. GitHub warns that scheduled events can be delayed during periods of high load, especially near the start of an hour, and some queued jobs may be dropped. Pick a minute away from :00 and treat the scheduled time as a target rather than an exact capture time. See GitHub’s workflow event documentation for current scheduling details.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Create .github/workflows/daily-capture.yml:

name: Daily product screenshots

on:
  schedule:
    - cron: '17 8 * * *'
  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: node capture-prices.js
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: product-screenshots-${{ github.run_id }}
          path: screenshots/
          if-no-files-found: ignore

The example cron expression requests 08:17 UTC each day; it is not a promise of execution at that exact minute. Change it to the desired UTC time. Workflow artifacts provide a way to retrieve files from a run, but define a separate retention or storage plan if you need a longer-lived historical archive.

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

Monitor completion, not just scheduling

The script exits with a nonzero status if one or more targets fail, allowing the workflow to show the run as failed. Configure notifications for failed workflow runs in the way that fits your team. Also check for a missing daily record: a schedule can be delayed or dropped, and a workflow might not produce an artifact even if the schedule was configured correctly. A useful record includes the target ID, date, status, and screenshot path or error.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Access, reliability, and cost considerations

Check permission and keep the workload restrained

Review each retailer’s terms and any permission requirements before automating captures, and avoid unnecessary concurrency. IETF RFC 9309, the Robots Exclusion Protocol (September 2022), states: “These rules are not a form of access authorization.” A robots.txt rule is not by itself authorization to access a site, nor does an unblocked page establish that collection is permitted. See the IETF standard. Do not bypass logins, CAPTCHAs, or other access controls. If an authorized target requires credentials, keep them out of source control.

Plan for runtime and storage

Browser startup and page rendering add time beyond the nominal once-a-day schedule. Keep concurrency modest and allow enough job runtime for the slowest page and its selector timeout. Screenshots can grow quickly when full pages are captured; choose whether full-page context is worth the storage, and set a retention policy for artifacts or copied files. GitHub Actions’ scheduled-workflow documentation describes the schedule behavior, not a guaranteed completion window for this workload.

Common failures and fixes

  • The price selector times out: the selector may be wrong, the page may have changed, or the price may not have rendered. Inspect the page manually, update the site-specific selector, and keep the run marked failed until the visible price is found.
  • Screenshot is blank or missing the price: the screenshot may have run before client rendering completed, or the price may be outside a selector’s visible state. Wait on a price-specific visible selector and verify the captured viewport or full-page result.
  • Navigation times out: the site may be slow or have persistent network activity. Check the URL and target behavior, use a readiness condition suited to that page, and adjust the navigation timeout only when there is a justified need. Avoid treating an unverified capture as success.
  • Layout differs across days: confirm the viewport is set before navigation and remains identical, and check whether the site’s responsive layout or content has changed.
  • No run appears at the expected time: check that the workflow is on the default branch and review GitHub Actions run history. Scheduled events can be delayed or dropped, so use a missing-record alert rather than relying only on the cron expression.
  • The job fails in CI but works locally: inspect the workflow logs for dependency or browser-launch errors, verify the installed Node.js and Puppeteer setup, and make sure the workflow installs dependencies from the lockfile with npm ci.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. A single GET request can return a PNG, JPEG, WebP, or PDF, and its API accepts common screenshot parameter names used by other screenshot APIs. See ScreenshotNeo and the API documentation.

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

For a daily capture, call the API from your scheduled job and save the response under a dated filename. This cURL example saves a WebP of a product URL:

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

Cookie banners are accepted and removed before the shot, along with supported newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and whether it was billed. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up free for ScreenshotNeo 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.

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.

GitHub ActionsNode.jsprice monitoringPuppeteerscreenshotsweb automation

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.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
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.