iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use Puppeteer to open a page and save a screenshot; use cron to run that script on a schedule. A reliable setup needs a fixed capture environment, an explicit output path, logs, and a plan for deciding whether an image difference matters. The steps below create a daily capture job and explain what you still need to add for actual visual-change alerts.
What the setup does—and what it does not
Puppeteer controls a browser and captures the page. Cron starts your script at scheduled times; it does not inspect images or decide whether a change is important. A screenshot history lets you review or compare captures, but monitoring also requires a change rule and a way to notify someone when that rule is met.
The example uses Node.js, Puppeteer, and a per-user crontab on a Unix-like host. Paths, browser dependencies, cron implementation, and timezone behavior depend on the host. The Puppeteer documentation describes the screenshot API; cron’s schedule and environment behavior are documented in the POSIX crontab specification and the POSIX cron specification.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Install Node.js, Puppeteer, and its browser
In a project directory, install the full puppeteer package. Its installation process downloads a compatible Chrome browser. The alternative package, puppeteer-core, does not download a browser, so use it only when you will provide and manage a compatible browser yourself. Package managers may block install scripts; if that happens, install the browser explicitly with Puppeteer’s browser-install command. See Puppeteer installation guidance.
#1 Best Overall
- ONGOING PROTECTION Download instantly & install protection for 5 PCs, Macs, iOS or Android devices in minutes!
- TOP-PERFORMING VPN Faster speeds, more server locations, and greater connection control to protect your privacy across all your devices, including Smart TVs.
- ADVANCED SCAM PROTECTION Help spot hidden scams online. With the built-in Genie AI assistant, you’ll never wonder if a message or email is suspicious again.
- REAL-TIME PROTECTION Advanced security protects against existing and emerging malware threats, including ransomware and viruses, and it won’t slow down your device performance.
- DARK WEB MONITORING Identity thieves can buy or sell your information on websites and forums. We search the dark web and notify you should your information be found.
mkdir -p /opt/site-monitor
cd /opt/site-monitor
npm init -y
npm install puppeteer
If the browser was not downloaded during package installation, run this from the project directory:
npx puppeteer browsers install
Keep the project’s dependency versions under control so that an update to Puppeteer or its browser does not silently change the capture environment. On Linux and cloud hosts, Chrome may also require platform-specific shared libraries or sandbox configuration; consult Puppeteer’s troubleshooting guide for deployment issues.
Create the screenshot script
Save this as /opt/site-monitor/capture.mjs. It uses environment variables for the target URL and destination, fixes the viewport, waits for a typical network-idle condition, verifies that navigation returned a successful HTTP response, and closes the browser even if navigation or capture fails.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
import puppeteer from 'puppeteer';
const url = process.env.TARGET_URL;
const outputPath = process.env.SCREENSHOT_PATH;
if (!url || !outputPath) {
throw new Error('Set TARGET_URL and SCREENSHOT_PATH');
}
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900 });
const response = await page.goto(url, {
waitUntil: 'networkidle2',
timeout: 60_000,
});
if (!response || !response.ok()) {
throw new Error(
`Navigation did not return a successful response: ${response?.status()}`
);
}
await page.screenshot({ path: outputPath, fullPage: true });
} finally {
await browser.close();
}
Puppeteer’s API call for saving an image is page.screenshot(). The example requests a full-page PNG because the output filename ends in .png. You can set fullPage: false for the viewport, use clip to capture a specific rectangle, and select a supported image type such as JPEG or WebP. When screenshots are compared over time, keep the viewport, scope, browser version, authentication, locale, and other page settings consistent. Puppeteer documents the screenshot options at ScreenshotOptions.
Choose a useful readiness condition
networkidle2 in the example is a starting point, not proof that every page has finished rendering. Pages with delayed content may need a site-specific selector or readiness signal after navigation. For example, wait for a stable content element with await page.waitForSelector('.page-ready') if that selector genuinely indicates the page is ready. A fixed delay can help with known animation or delayed rendering, but it can also waste time or still capture too early. Pick and validate the condition for the page you monitor.
Rank #2
- ONGOING PROTECTION Download instantly & install protection for 3 PCs, Macs, iOS or Android devices in minutes!
- TOP-PERFORMING VPN Faster speeds, more server locations, and greater connection control to protect your privacy across all your devices, including Smart TVs.
- ADVANCED SCAM PROTECTION Help spot hidden scams online. With the built-in Genie AI assistant, you’ll never wonder if a message or email is suspicious again.
- REAL-TIME PROTECTION Advanced security protects against existing and emerging malware threats, including ransomware and viruses, and it won’t slow down your device performance.
- DARK WEB MONITORING Identity thieves can buy or sell your information on websites and forums. We search the dark web and notify you should your information be found.
Choose output and retention behavior
The script requires an explicit output path. Puppeteer interprets a relative screenshot path relative to the process working directory, which may differ under cron, so prefer an absolute path. Create the destination directory in advance and make it writable by the scheduled user.
The sample path below is named latest.png, so each successful run replaces the prior image. If you want a history, generate filenames with timestamps and define how long to keep them; retention is an operational choice, not something cron or Puppeteer supplies automatically.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRun the script from cron
For a daily run at 07:00, edit the crontab belonging to the user that should own the browser process and output files:
crontab -e
Add one line, adjusting all absolute paths to match your host:
0 7 * * * TARGET_URL='https://example.com' SCREENSHOT_PATH='/var/lib/site-monitor/latest.png' /usr/bin/node /opt/site-monitor/capture.mjs >> /var/log/site-monitor.log 2>&1
The five schedule fields are minute, hour, day of month, month, and day of week. In this example, 0 7 * * * means 07:00 every day according to the cron service’s configured timezone. A user crontab runs as the owner of that crontab. Cron supplies a default shell and a limited environment rather than your interactive terminal’s full login environment, so use the correct absolute Node path, script path, and writable output and log directories. Check your host’s cron documentation for timezone and implementation-specific behavior.
Rank #3
- Used Book in Good Condition
Test under the scheduled user’s conditions
-
Create the output and log directories, then grant the scheduled user the permissions it needs. Keep API keys, cookies, and other secrets out of world-readable files and logs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Find the Node executable path with
command -v nodein the intended environment and use that absolute path in the crontab. -
Run the same command as the crontab owner from a clean shell, with the same environment variables and paths. Confirm that the screenshot appears at the expected location and that a failed run leaves a useful log entry.
-
After adding the cron entry, inspect the log and output after its next scheduled run. Cron mail may be available for unredirected output, but delivery depends on the system’s implementation and configuration; explicit log redirection makes output easier to inspect locally.
Turn screenshots into a monitoring signal
Capture alone does not define what counts as a meaningful change. Choose these policies for the page and the people who need to act on a change:
Rank #4
- THREAT DETECTION – Stay one step ahead. Suspicious links, risky sites, viruses, and scams, caught automatically before they reach you.
- PERSONAL INFO PROTECTION – Keep your personal info safer. Identity monitoring watches for your exposed info and tells you what to do about it.
- SECURE CONNECTIONS – Just a few easy clicks, and we'll automatically protect your info on public Wi‑Fi, every time you connect.
- GUIDED ACTION – Know what matters and what to do next. Clear alerts and simple guidance make it easy to take action.
- MORE THAN ANTIVIRUS – Scam protection, identity monitoring, VPN, web protection, and antivirus work together to protect you, all in one place.
-
Frequency and history: decide how often to capture and how long to retain images. More frequent runs create more files and more opportunities to review changes.
-
Scope: choose viewport, full-page, or a clipped region. Full-page captures reveal lower content but may include more dynamic areas.
-
Repeatability: hold viewport, browser version, cookies or authentication, locale, and readiness condition steady. Otherwise, differences may reflect the capture setup rather than a site change.
-
Noise tolerance: pixel-by-pixel comparison is sensitive to small rendering changes. Region-aware comparison or a threshold can reduce noise, but there is no universal threshold that fits every page. Clocks, ads, rotating content, animations, and consent banners can produce expected differences.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Failure handling: record navigation status and errors, decide whether and when to retry, and choose an alert channel. A failed capture should be distinguishable from a successful capture whose image differs.
-
Operations: decide where the job runs, who can read its files, how browser dependencies are maintained, and what happens if the host or target site is unreachable.
Cron and Puppeteer provide scheduling and capture primitives; they do not prescribe an image-diff algorithm, alert threshold, retention policy, or service-level objective. Add those explicitly if the workflow must notify someone rather than simply preserve images for review.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common failures
| Symptom | Likely cause | What to check or change |
|---|---|---|
The script reports that TARGET_URL or SCREENSHOT_PATH is missing. |
The environment variables were omitted or misspelled. | Set both variables in the cron line or in a protected environment file loaded by the script. |
Cannot find package 'puppeteer' or a module-loading error appears. |
Cron is running from a different working directory, or dependencies were not installed in the project. | Install Puppeteer in /opt/site-monitor and ensure the script resolves the package from that project. Test the exact cron command from a clean shell. |
| Chrome executable or shared-library errors appear. | The browser download did not run, or the host lacks runtime libraries. | Run npx puppeteer browsers install in the project and review the platform-specific dependency guidance in Puppeteer troubleshooting. |
| Chrome exits immediately in Linux or a container. | Host sandbox or permissions requirements differ from the local machine. | Review Puppeteer’s deployment troubleshooting for the specific environment rather than copying a broad sandbox workaround; configure the host securely. |
| No image appears, or the job cannot open the destination. | The parent directory does not exist, the scheduled user lacks write access, or a relative path resolved somewhere unexpected. | Create the directory, grant the crontab owner write access, and use an absolute screenshot path. |
| The screenshot is blank, incomplete, or intermittently times out. | The page may need a site-specific readiness condition, or the target may be slow or unreachable. | Check the logged navigation error and HTTP status; adjust the wait condition to a meaningful selector or application readiness signal, and choose a timeout suitable for the site. |
| It works interactively but not on schedule. | Cron has a different PATH, environment, working directory, user, permissions, or timezone context. | Use absolute paths, set required variables, test as the crontab owner, and inspect the redirected log and cron configuration. |
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Instead of installing and maintaining a browser for this capture, make one GET request; for scheduled monitoring, call it from your scheduler and store the returned image. Its cleanup can accept cookie or consent banners and remove known consent platforms, newsletter popups, and chat widgets before capture. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether the request was billed. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf.
Recommended Free Tools
cURL example, with the API options documented at ScreenshotNeo docs:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo includes 1,000 screenshots per month on the free plan with no card; paid plans start at $5 for 3,000 screenshots. Sign up for the free plan.
Frequently Asked Questions
Does cron take the screenshot itself?
No. Puppeteer captures the page; cron starts the capture script at scheduled times.
Will `networkidle2` always mean the page is ready?
No. It is a navigation wait condition, not a universal visual-readiness guarantee. Use a page-specific selector or readiness signal when needed.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesDoes this example alert me when a page changes?
No. It saves an image. You must add comparison rules and a notification path if you want change alerts.
Quick Recap
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.

