shot-scraper
$ shot-scraper Community Med Riskshot-scraper wraps Playwright in crisp single-command subcommands: capture PNG screenshots, export PDFs, inspect accessibility trees (accessibility), or run shot-scraper javascript to extract page data directly as JSON.
brew install shot-scraper Great single-shot CLI for javascript JSON extraction and visual shot verification; use a browser subagent for multi-step stateful UI flows.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Clean javascript and accessibility subcommands emit pure JSON directly to stdout without TUI prompts.
shot-scraper javascriptandaccessibilityoutput JSON to stdout
One-shot read/render commands; headless browser executes remote page JavaScript and supports optional --auth context files.
- Read-only DOM extraction unless
-owrites image/PDF locally
Easy pip/brew/uvx install, though requires shot-scraper install to fetch Chromium.
- Python CLI requiring Playwright browser binary download
Zero-boilerplate replacement for ad-hoc Playwright scripts when capturing screenshots, PDFs, or JSON DOM slices.
- Single-command screenshot, PDF, accessibility, and JS-to-JSON execution
Maintained by Simon Willison (simonw/shot-scraper) under Apache-2.0.
simonw/shot-scraperrepository
Well-written documentation at shot-scraper.datasette.io.
- Official docs at shot-scraper.datasette.io
Security, Auth & Guardrails
Accepts --auth JSON state files, --auth-user/--auth-password, or HTTP headers transiently; stores no credentials by default.
Free, Apache-2.0 open-source Python CLI; requires Playwright Chromium download.
# shot-scraper Agent Rules - Run `shot-scraper install` once per environment if Chromium is not yet cached. - Bound long-running pages with `--timeout <ms>` and avoid passing `--auth` state files to untrusted URLs.
Agent-Ready Command Recipes
Safe Read-Only Queries
shot-scraper javascript https://example.com "({title: document.title, h1: document.querySelector('h1')?.innerText})" Loads the page headlessly, evaluates JS, and prints clean JSON to stdout.
shot-scraper accessibility http://localhost:4321
Dumps the browser's accessibility snapshot as JSON without saving image files.
Controlled Writes & Previews
shot-scraper http://localhost:4321 -s '#main' -w 1280 -o preview.png
Renders #main at 1280px width and writes preview.png to disk.
Strengths for Agents
- +
shot-scraper javascriptandaccessibilityreturn clean JSON without writing any script files. - + Zero-boilerplate selector (
-s), viewport (-w/-h), and--waitflags for visual checks.
Caveats & Pitfalls
- ! Requires
shot-scraper install(Playwright Chromium ~300 MB) on fresh environments. - ! Meant for single-page shots rather than multi-step login/checkout flows.