🤖 AI Hot

Record AI Agent Demos with shot-scraper Video

A
Alex Chen

The Problem Nobody Talks About

AI agents that control browsers are hard to debug. You stare at terminal logs and trace output wondering what the agent actually saw, which button it clicked, why it navigated three pages deep instead of one. When your browser-use agent messes up, the evidence evaporates. The tab is already closed by the time you realize something went wrong.

That’s where shot-scraper video comes in. Simon Willison’s tool, best known for archiving web pages as screenshots, now has a video recording mode that captures every page your agent visits as an MP4. It’s a screen recording that only shows what actually happened in the browser — no OBS setup, no screen recording of your entire desktop, just a clean replay of the agent’s session.

I’ve been using this for about two weeks with a Playwright-based agent I built for scraping research papers. Here’s what I learned, and why you might want this in your toolkit whether you’re debugging agents, presenting demos, or documenting edge cases.

What shot-scraper Video Actually Does

shot-scraper is a CLI tool that wraps Playwright’s screenshot capabilities. You point it at a URL and it opens a headless browser, loads the page, and saves a PNG. The video subcommand extends this: it records the entire browser session as a video file.

The basic usage is straightforward:

# Record a 30-second video of a single page with scrolling
shot-scraper video https://example.com \
  --output demo.mp4 \
  --duration 30 \
  --scroll

# Record multiple URLs as a sequence
shot-scraper multi https://site1.com https://site2.com \
  --output workflow.mp4

But the real power comes from using it inside an agent’s tool-calling loop. Instead of calling page.goto(url) directly, your agent calls shot-scraper video --output session_{timestamp}.mp4 as one of its tools. The agent doesn’t need to know it’s being recorded — the recording happens as a side effect of the browser interaction.

For autonomous agents, this means every session produces a video artifact. Failed runs leave behind a replay. Successful runs give you material for demos and documentation. You can build a simple wrapper that archives these videos alongside the agent’s logs and traces.

How I Wired It Into a Playwright Agent

My setup is about 40 lines of Python. The agent has a navigate tool that normally calls Playwright directly. I added a record_navigate variant that shells out to shot-scraper instead:

import subprocess
import time
from datetime import datetime

def record_navigate(url: str, output_dir: str = "./recordings") -> str:
    """Navigate to URL and record the interaction as video."""
    timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
    output_path = f"{output_dir}/session_{timestamp}.mp4"
    
    result = subprocess.run([
        "shot-scraper", "video", url,
        "--output", output_path,
        "--duration", "15",
        "--width", "1280", "--height", "720",
        "--scroll"
    ], capture_output=True, text=True, timeout=30)
    
    if result.returncode == 0:
        return f"Navigated to {url}. Recording saved to {output_path}"
    return f"Navigation failed: {result.stderr[:200]}"

The agent gets this as one of its available tools. When it decides to visit a page, it calls record_navigate instead of a raw Playwright call. The video captures everything: page load, scrolling, the agent waiting for content to render. If the agent needs to interact with forms or buttons, you’d extend this to accept click coordinates or selectors — shot-scraper supports JavaScript execution too, so you can chain interactions.

The tradeoff is speed. Recording adds 2-4 seconds of overhead per page visit because shot-scraper waits for the full duration to capture smooth video. For agents that visit dozens of pages per task, this adds up. I run recording mode selectively — only when debugging or when a task is tagged as “demo-worthy” in the prompt.

Three Use Cases That Actually Matter

Debugging agent failures. When your agent gets stuck in a loop or produces wrong results, reading the trace logs tells you what it tried to do. Watching the recording tells you what it actually did. A few weeks ago my research-scraping agent kept skipping a specific journal’s papers. The logs said “page not found” but the recording showed the page loaded fine — the agent’s content selector was targeting a class name that had changed. Without the video, I’d have spent an hour suspecting network issues or rate limiting.

Stakeholder demos without live pressure. Demoing AI agents live is stressful. They’re nondeterministic. Half the time they do something unexpected that derails your narrative. Record the session beforehand, pick the cleanest run, and present the video. You can narrate over it, pause to explain decisions, and skip the parts where the agent hallucinates a nonexistent button. I’ve done this twice for internal demos and the reception is noticeably better — people focus on the capability instead of the glitches.

Building a failure library for training. If you’re fine-tuning an agent or writing better prompts, you need examples of what went wrong. Recordings of failed runs are concrete artifacts. You can review them with the team, annotate specific moments where the agent made the wrong call, and use those to improve system prompts or tool descriptions. Simon Willison has talked about using shot-scraper recordings to build “how did this fail” case studies for his own projects.

What shot-scraper Won’t Do

Don’t expect this to replace full observability platforms. shot-scraper video records what’s on screen — it doesn’t capture network requests, console logs, or the agent’s internal reasoning chain. If your agent misclicks a button because of a race condition, the video will show the misclick but won’t tell you why it happened. You still need structured logging for that.

The video quality is also dependent on the headless browser’s rendering. Some pages with heavy JavaScript animations or WebGL content may not render perfectly. For most web apps and documentation sites, it’s fine. For complex dashboards with real-time data streams, expect some visual artifacts.

File sizes add up faster than you’d think. A 30-second recording at 720p is around 3-5 MB. Run 20 agent sessions a day and you’re looking at 100 MB of video. Set up a retention policy — keep the last N days of recordings, or only save sessions where the agent encountered an error.

And shot-scraper is fundamentally a screenshot tool, not a screen recorder. The video command works by capturing frames during page interactions. If your agent spends 5 minutes reading and reasoning between page visits, that dead time becomes 5 minutes of a static webpage in the recording. You’ll want to trim those sections if you’re making a demo.

Alternatives Worth Considering

If shot-scraper doesn’t fit your stack, here’s what else is out there:

Playwright’s built-in trace viewer (playwright codegen --trace) gives you frame-by-frame replay of every action with timing data and network logs. It’s more powerful for debugging but produces .zip trace files instead of shareable MP4s. Better for engineering teams, worse for demos.

rrweb records DOM snapshots and replays them in the browser. It’s lighter than video (the recordings are JSON, not MP4) and lets you inspect the DOM at any point in the replay. Great for web app testing, but the replay only works in rrweb’s player — you can’t send it as a Slack attachment.

OBS + virtual display is the nuclear option. Spin up Xvfb, point OBS at it, run your agent. You get full control over resolution, framerate, and encoding. It’s also 10x more setup work and consumes significantly more resources. Only worth it if you need broadcast-quality output or are recording very long sessions.

Loom / CloudApp are fine for human recordings, but no CLI or API makes them useless for automated agent capture.

For my use case — an agent that visits 5-15 pages per task and I want a quick visual trace — shot-scraper hits the sweet spot. Five lines of config, MP4 output, zero infrastructure.

Integrating With Agent Frameworks

The pattern I described — wrapping the browser interaction in a tool that records — works with any agent framework that supports custom tools. Here’s how the integration looks across the popular ones:

LangChain / LangGraph: Define record_navigate as a @tool decorated function. The agent’s ReAct loop calls it like any other tool. LangGraph’s checkpointing means you can correlate specific video timestamps with the agent’s state transitions — when you rewind the video to second 23 and the agent decided to click a different link, you can check the graph state at that exact node execution.

CrewAI: Register it as a tool on your agent. CrewAI’s built-in tool delegation means a research agent can hand off navigation tasks to a dedicated “browser agent” that uses shot-scraper. The video recording acts as an audit trail for what the browser agent actually retrieved, which is useful when the research agent’s output doesn’t match expectations.

OpenAI Agents SDK / Swarm: The SDK’s function calling interface maps cleanly to shell commands. Define record_navigate(url, duration) as a function tool. The streaming API shows you when the model decides to call it — you can match those decision timestamps against the video timeline to understand whether the model navigated to the right page for the right reason.

The common thread: shot-scraper sits one level below the agent framework. The framework doesn’t know it’s being recorded. The recording is a side channel that produces evidence without adding coupling to the agent’s decision loop. This separation matters because you don’t want your debugging infrastructure to become a dependency that can break your agent in production.

One caveat: if your agent runs inside Docker or on a remote server, you’ll need a virtual display (Xvfb) for shot-scraper. Headless mode usually works, but some sites serve different content to headless browsers. If visual fidelity matters, run with --headed and a display server.

Who Should Use This

If you’re building browser-use agents and any of these apply, try shot-scraper video:

  • You spend more than 15 minutes a week debugging agent navigation issues
  • You demo your agent to non-technical stakeholders
  • You’re collecting failure examples to improve your prompts or fine-tune models
  • Your agent operates on sites where visual correctness matters (e-commerce, dashboards, data extraction from charts)

Who Should Skip It

  • Teams that already have LangSmith, Arize, or another observability platform with session replay. You’re covered.
  • Solo developers running CLI-only agents (no browser). The recording adds nothing over structured logs.
  • Anyone building agents that process hundreds of pages per task. The recording overhead per page will make your tasks take 2-3x longer.

The Bottom Line

Recording agent browser sessions is one of those things that feels like overkill until the first time you need it. Then you can’t imagine debugging without it. shot-scraper video is the lowest-friction way I’ve found to get there — no infrastructure, no SaaS, no subscription. It’s a single binary that does one thing and does it well.

I’ve been running it in recording mode for my weekly agent review sessions. Watching the recordings with the team surfaces bugs that nobody noticed in text logs. Last week we found an agent that was scrolling past the “accept cookies” banner on every single page, silently failing to click it, and then trying to interact with buttons that were hidden behind the banner overlay. The logs showed “clicked element #submit” successfully. The video showed the cookie banner blocking everything. That alone paid for the setup time.

If your agents use browsers, record what they do. shot-scraper makes it almost too easy not to.

Disclosure: CarCare Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you. Learn more.
A
Alex Chen