/crawlberg:crawlberg-automating-the-browserfrom crawlberg
Drives a headless browser through scripted interactions (click, type, press, scroll, wait, screenshot, run JS) before capturing the DOM. Use when static scraping fails for dynamic content.
Ships in crawlberg. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
crawlberg interact <url> --actions '[...]' drives a real headless browser
through an ordered list of actions, then captures the resulting page. Reach for
it when a static scrape is not enough: the content lives behind a "Load more"
button, an infinite scroll, a form submission, or JS that only runs on
interaction.
crawlberg interact https://example.com \
--actions '[{"type":"click","selector":"#load-more"},
{"type":"wait","milliseconds":500},
{"type":"scrape"}]'
Actions run in order. The result wraps the final page state under
interaction (see Output below).
| Flag | Default | Purpose |
|---|---|---|
--actions | — | Required. JSON array of action objects (see below). |
--format | json | json (full result) or markdown (final HTML only). |
--timeout | 30000 | Per-request timeout in ms. |
--browser-mode | auto | auto, always, never. Interaction needs a browser. |
--browser-endpoint | — | External CDP ws:// or wss:// URL. |
--config | — | Inline JSON or @file.json for the full CrawlConfig. |
There is no --respect-robots-txt flag on interact; it targets the one URL
you point it at.
Each action is a JSON object tagged by type (camelCase). Unknown fields are
rejected, so match the shapes exactly:
type | Fields | Notes |
|---|---|---|
click | selector | Click the element matching the CSS selector. |
type | selector, text | Type text into the input matching selector. |
press | key | Press a key, e.g. "Enter", "Tab", "Escape". |
scroll | direction ("up"/"down"), selector?, amount? | Scroll the page, or a scrollable element if selector is set. |
wait | milliseconds?, selector? | Wait a fixed time, or until selector appears (selector wins). |
screenshot | fullPage? | Capture the viewport, or the full scrollable page if true. |
executeJs | script | Run arbitrary JS in the page context. Trusted scripts only. |
scrape | — | Capture the current page HTML into the result. |
There is no select action and no wait_for_selector action: to wait for an
element, use wait with a selector field. Scroll direction is up or
down only.
wait: max 300000 ms; total wait across all wait actions: max 300 s.selector max 4096 bytes; text and executeJs script max 1 MB each.scroll amount max 100000 px (absolute).The result is wrapped under an interaction key. It carries the final page
HTML (interaction.final_html) and a per-action record under
interaction.action_results[...] — including screenshot data and executeJs
return values where applicable.
crawlberg interact https://example.com \
--actions '[{"type":"type","selector":"#q","text":"rust"},
{"type":"press","key":"Enter"},
{"type":"wait","selector":".results"},
{"type":"scrape"}]' \
--format json | jq '.interaction.final_html | length'
Prints interaction.final_html directly — the raw final DOM, not converted
Markdown. Use JSON mode and feed final_html to a scrape step when you need
clean Markdown.
crawlberg interact https://example.com/feed \
--actions '[{"type":"scroll","direction":"down"},
{"type":"wait","milliseconds":800},
{"type":"scroll","direction":"down"},
{"type":"wait","milliseconds":800},
{"type":"scrape"}]'
crawlberg interact https://app.example.com \
--actions '[{"type":"type","selector":"#email","text":"[email protected]"},
{"type":"type","selector":"#password","text":"..."},
{"type":"click","selector":"button[type=submit]"},
{"type":"wait","selector":".dashboard"},
{"type":"screenshot","fullPage":true}]'
Never hardcode credentials — pass them from the environment or a secrets store.
crawlberg interact https://example.com \
--browser-endpoint ws://browser.internal:9222/devtools/browser/<id> \
--actions '[{"type":"click","selector":"#go"},{"type":"scrape"}]'
See the crawlberg-headless-fallback skill for CDP endpoints, wait strategies, and
persistent browser profiles set via --config.
If the page yields its content on a plain fetch (or via --browser-mode always) with no clicking or typing, use crawlberg scrape — see
crawlberg-scraping-html-to-markdown. Use interact only when ordered actions must run
before the content exists.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub xberg-io/crawlberg --plugin crawlberg7 skills in this plugin
/crawlbergCrawl, scrape, and convert websites to Markdown using the local crawlberg CLI and its MCP server. Use when the user wants to fetch a page, follow links across a domain, enumerate URLs, or drive a real browser. Covers installation, the subcommands (scrape, crawl, map, interact, batch-scrape, batch-crawl, download, citations, version, mcp, serve), output formats (JSON + Markdown), browser fallback, and when to prefer the MCP server over shelling out./crawlberg-crawling-a-siteUse when the user wants to follow links across a domain and capture every reachable page as Markdown. Covers `crawlberg crawl` with depth, page caps, concurrency, rate limiting, domain scoping, robots, and output selection./crawlberg-headless-fallbackUse when a static fetch returns nothing useful and the page needs a real browser. Covers `--browser-mode auto|always|never`, external CDP via `--browser-endpoint`, symptoms of JS-only pages and WAF blocks, and the performance cost./crawlberg-mapping-urlsUse when the user wants the list of URLs on a site rather than the page content — sitemap analysis, link planning, or seeding another tool. Covers `crawlberg map URL` with `--limit`, `--search`, robots, output, and how it differs from a full crawl./crawlberg-scraping-html-to-markdownUse when the user wants a single page rendered as clean Markdown plus structured metadata. Covers `crawlberg scrape URL`, JSON vs Markdown output, what metadata is returned, and how to handle JS-heavy pages./crawlberg-serving-the-apiUse when the user wants a long-running HTTP service for scrape/crawl/map instead of one-shot CLI calls or the MCP server — for example wiring crawlberg into other apps over REST. Covers `crawlberg serve`, the Firecrawl-v1-compatible endpoints, `--host`/`--port`, and when to prefer it.Other plugins' skills for the same job