Loading...
Loading...
Use when capturing screenshots of local projects, documenting web app UI, taking screenshots of localhost dev servers, or generating images for READMEs and docs. Use when asked to "screenshot my app", "capture the UI", "take a screenshot of localhost", "generate screenshots for docs", "batch screenshot my pages", or "set up shot-scraper".
npx skill4agent add antjanus/skillbox screenshot-localrecord-tui# Install pipx if needed
brew install pipx # macOS
# or: apt install pipx / pip install pipx
# Install shot-scraper globally
pipx install shot-scraper
# Install the browser engine (Chromium by default)
shot-scraper installshot-scraper --versionshot-scraper install -b firefox
shot-scraper install -b webkit| Use Case | Width | Height | Format |
|---|---|---|---|
| README hero image | 1280 | 800 | PNG |
| Docs screenshot | 1200 | auto | PNG |
| Social/OG image | 1200 | 630 | PNG |
| Mobile viewport | 375 | 812 | PNG |
| Tablet viewport | 768 | 1024 | PNG |
| Full page capture | 1280 | (omit) | PNG |
shot-scraper http://localhost:3000 -o homepage.pngshot-scraper index.html -o preview.pngshot-scraper http://localhost:3000 -w 1200 -h 800 -o homepage.pngshot-scraper http://localhost:3000 --retina -o homepage-retina.pngshot-scraper http://localhost:3000 -s ".hero-section" -o hero.png
shot-scraper http://localhost:3000 -s "#main-nav" --padding 10 -o nav.png# Wait fixed time (ms)
shot-scraper http://localhost:3000 --wait 2000 -o page.png
# Wait for JS condition
shot-scraper http://localhost:3000 --wait-for "document.querySelector('.loaded')" -o page.pngshot-scraper http://localhost:3000 \
-j "document.querySelector('.cookie-banner')?.remove()" \
-o clean-homepage.png| Flag | Example | Purpose |
|---|---|---|
| | Output filename |
| | Viewport width (default: 1280) |
| | Viewport height (omit for full page) |
| | CSS selector to capture |
| | All matching elements |
| | Padding around selector (px) |
| | 2x device pixel ratio |
| | Save as JPEG with quality |
| | Wait ms after page load |
| | Wait until JS returns true |
| | Execute JS before screenshot |
| | Browser (chromium/firefox/webkit) |
| | Transparent background (PNG) |
| | Failure timeout (ms) |
shots.yml# shots.yml
- url: http://localhost:3000
output: screenshots/homepage.png
width: 1280
height: 800
- url: http://localhost:3000/about
output: screenshots/about.png
width: 1280
- url: http://localhost:3000/dashboard
output: screenshots/dashboard.png
width: 1280
height: 900
wait: 2000
javascript: |
document.querySelector('.loading-spinner')?.remove()
- url: http://localhost:3000
output: screenshots/mobile-home.png
width: 375
height: 812shot-scraper multi shots.yml- url: http://localhost:3000/form
output: screenshots/form-filled.png
width: 1200
javascript: |
document.querySelector('#name').value = 'Jane Doe';
document.querySelector('#email').value = 'jane@example.com';
wait: 500
selector: ".form-container"
padding: 20
retina: trueurloutputwidthheightqualitywaitwait_forselectorselectorsselector_allpaddingjavascriptjs_selectorretinaomit_background# Validate by running
shot-scraper multi shots.ymlshot-scraper http://localhost:3000 --quality 85 -o page.jpgshot-scraper http://localhost:3000 -s ".component" --omit-background -o widget.pngwidthheight--retina--waitjavascriptselectorpaddingname: Update Screenshots
on:
push:
branches: [main]
paths: ["src/**", "shots.yml"]
jobs:
screenshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install shot-scraper
run: |
pip install shot-scraper
shot-scraper install
- name: Capture screenshots
run: |
npm ci && npm run dev &
sleep 5
shot-scraper multi shots.yml
- name: Commit updated screenshots
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "docs: update screenshots"
file_pattern: "screenshots/*.png"server# shots.yml — explicit dimensions, proper waits, organized output
- url: http://localhost:3000
output: screenshots/homepage.png
width: 1280
height: 800
- url: http://localhost:3000/dashboard
output: screenshots/dashboard.png
width: 1280
height: 900
wait: 2000
javascript: |
document.querySelector('.toast-notification')?.remove()
- url: http://localhost:3000/settings
output: screenshots/settings.png
width: 1280
selector: ".settings-panel"
padding: 20
- url: http://localhost:3000
output: screenshots/mobile-home.png
width: 375
height: 812# No output specified — shot-scraper auto-names from URL, messy results
- url: http://localhost:3000
# No width — relies on default, inconsistent across machines
- url: http://localhost:3000/about
output: about.png
# No wait for SPA — captures loading spinner instead of content
- url: http://localhost:3000/dashboard
output: dashboard.png
# Screenshot directory not organized
- url: http://localhost:3000/settings
output: settings.png# Hero section with padding for breathing room
shot-scraper http://localhost:3000 -s ".hero" -p 20 -o docs/hero.png
# Navigation in retina for crisp text
shot-scraper http://localhost:3000 -s "nav" --retina -o docs/nav.png
# Form with pre-filled data via JS
shot-scraper http://localhost:3000/contact \
-j "document.querySelector('#name').value = 'Jane Doe'" \
-s ".contact-form" -p 10 -o docs/form.png# No selector — captures entire page when you only need one section
shot-scraper http://localhost:3000 -o hero.png
# No padding — element cropped tight, looks cramped in docs
shot-scraper http://localhost:3000 -s ".hero" -o hero.png
# No wait — dynamic component hasn't rendered yet
shot-scraper http://localhost:3000 -s ".chart" -o chart.png# Fixed wait
shot-scraper http://localhost:3000 --wait 3000 -o page.png
# Wait for specific element
shot-scraper http://localhost:3000 --wait-for "document.querySelector('.content')" -o page.pngnpm run dev &curl -I http://localhost:3000server-h-h--retinapipx install shot-scraper
pipx ensurepath # Add pipx bin to PATH
shot-scraper install # Install browser engine# Use --interactive to debug visually
shot-scraper http://localhost:3000 -i
# Use --devtools for inspector
shot-scraper http://localhost:3000 --devtools# Single screenshot
shot-scraper http://localhost:3000 -o page.png
# With dimensions
shot-scraper http://localhost:3000 -w 1280 -h 800 -o page.png
# Specific element
shot-scraper http://localhost:3000 -s ".hero" -p 10 -o hero.png
# Retina
shot-scraper http://localhost:3000 --retina -o page@2x.png
# Local HTML file
shot-scraper index.html -o preview.png
# Batch from YAML
shot-scraper multi shots.yml
# Interactive debugging
shot-scraper http://localhost:3000 -i
# PDF export
shot-scraper pdf http://localhost:3000 -o page.pdf