ScreenshotNeo

BlogHow-to

How to automate SingleFile captures with a scheduled browser task

Schedule SingleFile CLI captures for unattended jobs, or use extension auto-save in an open browser. Learn how to choose a workflow and handle failures.

By the ScreenshotNeo team4 October 20267 min read

For unattended recurring captures, run the SingleFile CLI from your operating system’s scheduler. The CLI runs a headless browser capture; the scheduler starts it at the times you choose. If the pages are already open in a browser you keep running, SingleFile’s extension can auto-save tabs after they load, but that is not a documented way to launch a closed browser on a schedule. SingleFile’s project README describes extension auto-save, and the CLI package listing describes the command-line route.

This guide shows how to choose and operate each workflow without assuming universal CLI flags or scheduler syntax. Confirm the current CLI command with its installed help before scheduling it: the package documentation and available flags can change.

1. Choose the capture workflow

Need Use How it starts
Run captures while no interactive browser session is needed SingleFile CLI plus a host scheduler The scheduler launches a CLI process at a chosen interval
Save tabs that are already open in a browser SingleFile extension auto-save The extension saves tabs after they load, or before unload if they have not yet been saved

The CLI package describes execution through Deno as a script injected into a headless browser. It uses Chrome DevTools Protocol with Chromium-based browsers or WebDriver BiDi with Firefox. Its listing also describes an executable download as an installation option and says Chrome or a Chromium-based browser should be available in the default location; if it is elsewhere, the CLI may need an explicit browser executable path.

The extension context menu can enable auto-save for the current tab, unpinned tabs, or all tabs. This is tied to tabs in an active browser. The official documentation does not describe it as a system scheduler or promise that it will launch a closed browser at a chosen time. The Chrome Web Store listing describes saving a complete page—including CSS, images, fonts, and frames—as a single HTML file. Options and defaults can vary by browser build, so check the installed extension’s options and help.

2. Set up and schedule the SingleFile CLI

  1. Install the CLI and browser. Follow the current SingleFile CLI installation documentation for your machine. Install a supported browser and note where its executable lives.
  2. Check the command your version supports. Run the installed CLI’s help and follow its current examples. The research sources do not establish a universal capture command or output flag, so do not paste an unverified command into a recurring job.
  3. Make one manual capture. Use a test URL and a writable destination. Confirm that the result is a single HTML archive and opens as expected. Test any authentication or site-specific behavior with the same browser and environment the scheduled job will use.
  4. Schedule the tested command. Configure your operating system’s scheduler to launch that exact command at the desired interval. Scheduler syntax and environment settings vary by platform; use the platform’s documentation for the schedule expression.
  5. Capture logs and check results. Record standard output and errors. Verify that the expected file exists and is non-empty after each run, and alert or investigate when the process exits unsuccessfully or the file is missing.
  6. Review the job periodically. Check browser and CLI updates, executable paths, destination permissions, available disk space, authentication/session requirements, and changes in the target site.

Keep the scheduled command and output location stable, and run the job under an account that can access both. A scheduler may provide a different working directory or environment from your interactive shell; use the CLI’s documented path options and your scheduler’s configuration to avoid relying on implicit defaults.

3. Configure extension auto-save for open tabs

  1. Install the SingleFile extension for your browser from its official distribution channel.
  2. Open the tab or tabs to save and use the extension’s context menu to enable auto-save for the current tab, unpinned tabs, or all tabs, depending on the desired scope.
  3. Review the extension’s current options and destination settings. The project README lists Google Drive and GitHub destinations; the Chrome listing also names Dropbox and WebDAV.
  4. Leave the browser running with the relevant tabs open. The documented behavior saves pages after loading, or before unloading if they have not already been saved.
  5. Check the output destination to confirm captures are arriving as expected.

The Chrome Web Store listing says to wait until a page is fully loaded before manually saving. Auto-save timing and results can depend on page behavior and extension settings. Do not treat this workflow as a guarantee that a page will be captured at a particular clock time.

4. Understand what is captured

SingleFile’s purpose is a self-contained HTML page capture. It brings page resources such as CSS, images, fonts, and frames into one HTML file, according to the extension listing. That archive is different from a screenshot: it is an HTML artifact intended to preserve a page, while an image is a visual snapshot.

Chrome Headless has related capture options, but they are not a substitute for SingleFile output. Chrome’s Headless documentation says --dump-dom prints the serialized DOM after Chrome parses the page and runs scripts; it is not just the original source HTML. Chrome also documents screenshot and PDF output, a capture timeout, and virtual time for time-dependent scripts. These capabilities do not establish that Chrome flags produce a SingleFile self-contained archive.

5. Reliability, performance, and operating cost

  • Site behavior: Dynamic pages, late-loading assets, authentication, and bot checks can affect the result. Validate representative pages and revisit the workflow if the site changes.
  • Browser compatibility: The CLI listing describes Chromium-based browsers and Firefox through different automation protocols. Check the selected browser and CLI combination on the actual scheduled machine.
  • Runtime: Each capture needs a browser process and time to load and serialize the page. Page size, scripts, and network conditions influence how long a run takes. Avoid overlapping scheduled runs if they could compete for resources or overwrite the same destination.
  • Storage: A single HTML file can contain embedded page resources. Estimate storage from your own captures and retention needs; the reviewed documentation provides no universal size or speed benchmark.
  • Cost: The CLI workflow uses your machine or hosted compute, browser installation, and storage. The sources reviewed do not provide a universal cost estimate. Extension cloud destinations may have their own account or storage terms; check those providers’ current terms.
  • Maintenance: Browser updates, changed executable paths, expired sessions, full disks, and modified scheduler environments are common reasons a previously working job stops producing useful files.

6. Troubleshooting scheduled captures

Symptom Likely cause What to check
CLI cannot start the browser The browser is missing or not at the expected default location Install a supported browser or set the CLI’s documented browser executable path option to the installed executable.
Manual run works, scheduled run does not The scheduler uses a different account, working directory, environment, or permissions Review the scheduled task’s account, paths, environment, and access to the destination. Log standard output and errors.
No output file appears The command may have failed, the destination may be unwritable, or the output location may differ from what you expect Inspect the exit status and logs, then verify the CLI’s current output options and destination permissions.
Archive is incomplete or page looks different The page had not finished loading, depended on a session, or changed its behavior Reproduce with the scheduled browser and account. Check the page’s load state, authentication requirements, and current extension or CLI options.
Extension does not save at a particular time Auto-save is tied to page load or unload in an open browser, not a documented clock-based scheduler Keep the browser and tabs open for extension auto-save, or use the CLI with a host scheduler for unattended launches.
Job becomes slow or runs out of disk space Pages or embedded resources are large, runs overlap, or old archives accumulate Review run frequency, concurrency, output retention, and free disk space.

7. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. For a screenshot rather than a SingleFile HTML archive, one GET request returns an image or PDF. The API accepts the common parameter names used by other screenshot APIs, which can make switching straightforward. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie banners are accepted like a visitor, and 60+ known consent platforms, newsletter popups, and chat widgets are removed before the shot; each step can be turned off.
  • Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing. Responses include X-Page-Verdict and X-Billed headers.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
  • The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots.

Sign up free for 1,000 screenshots a month, with no card required.

8. FAQ

Can the SingleFile extension start a capture when my browser is closed?

The official extension documentation describes auto-save for tabs in a browser session, not launching a closed browser on a system schedule. Use the CLI and a host scheduler when the job must start unattended.

Does Chrome’s --dump-dom create a SingleFile archive?

No. It outputs the serialized DOM after page parsing and script execution. Use SingleFile CLI when the intended artifact is a SingleFile HTML capture.

Can I save extension captures to a cloud destination?

The project README lists Google Drive and GitHub, and the Chrome listing names Dropbox and WebDAV. Check the installed extension’s current destination options and provider requirements.

Is a SingleFile capture the same as a screenshot?

No. SingleFile creates a single HTML page archive. A screenshot is an image, and a PDF is a separate document output.

Sources