automating-the-browser
Use when extracting a page needs scripted interaction first — click, type, press a key, scroll, wait, screenshot, or run JS before capturing the DOM. Covers `kreuzcrawl interact <url> --actions` with the real action schema, result shape, limits, and external-CDP options.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- automating-the-browser
- description
- Use when extracting a page needs scripted interaction first — click, type, press a key, scroll, wait, screenshot, or run JS before capturing the DOM. Covers `kreuzcrawl interact <url> --actions` with the real action schema, result shape, limits, and external-CDP options.
03 SKILL.md 正文
Automating the browser
kreuzcrawl 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.
Quick recipe
kreuzcrawl 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 surface
| 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.
Action schema
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.
Limits (enforced — exceeding them errors)
- Max 100 actions per call.
- Single
wait: max 300000 ms; total wait across allwaitactions: max 300 s. selectormax 4096 bytes;textandexecuteJsscriptmax 1 MB each.scrollamountmax 100000 px (absolute).
Output
JSON mode (default)
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.
kreuzcrawl 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'
Markdown mode
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.
Patterns
Expand lazy content, then capture
kreuzcrawl interact https://example.com/feed \
--actions '[{"type":"scroll","direction":"down"},
{"type":"wait","milliseconds":800},
{"type":"scroll","direction":"down"},
{"type":"wait","milliseconds":800},
{"type":"scrape"}]'
Capture a full-page screenshot after login
kreuzcrawl interact https://app.example.com \
--actions '[{"type":"type","selector":"#email","text":"me@example.com"},
{"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.
Point at an external Chrome
kreuzcrawl interact https://example.com \
--browser-endpoint ws://browser.internal:9222/devtools/browser/<id> \
--actions '[{"type":"click","selector":"#go"},{"type":"scrape"}]'
See the headless-fallback skill for CDP endpoints, wait strategies, and
persistent browser profiles set via --config.
When to reach for scrape or crawl instead
If the page yields its content on a plain fetch (or via --browser-mode always) with no clicking or typing, use kreuzcrawl scrape — see
scraping-html-to-markdown. Use interact only when ordered actions must run
before the content exists.
04 同仓库更多 Skills
migrate-to-e2e
Moves an existing Playwright, Cypress, Selenium, Appium, Detox, Maestro, or TesterArmy suite to e2e one slice at a time, with the old suite running beside the new one until each ported test is proven. Keeps a MIGRATION.md progress file so any later session resumes where the last stopped. Optionally plants a defect to show both suites catch it. Use for /migrate-to-e2e, "migrate our tests to e2e", "port these Maestro flows", "move our TesterArmy tests", or when a project has an e2e config and an older suite still running.
e2e
Writes, runs, and debugs end-to-end tests for web and mobile apps with e2e, the agentic test runner, which mixes agent.act goals with exact locator assertions on a Playwright browser or an iOS or Android device. Also drives a project's running app live over the e2e MCP server to look at a screen, check a UI change, take a screenshot or record a video, and try a locator; and runs bug bashes, parallel e2e explore runs with each bug proven by a repro test. Use when a project depends on e2e or has an e2e.config.ts, when asked for end-to-end, browser, mobile, or agentic UI tests, to check a change in the running app, to QA or bug bash an app or branch, or when an e2e run fails.
create-verification-skill
Generate a project-local verify-<app> skill on top of e2e, so any coding agent can launch the app, check it is worth driving, exercise a feature the way a user does, keep evidence, and bug bash it. Writes the skill, a feature map with one explore charter per feature, and proves it once. Use for /create-verification-skill, "make a verification skill for this repo", or when a project has no scripted way to prove UI behavior.
deja-search
deja-vu memory — search the user's past AI coding sessions with the deja CLI. Holds what they already settled and never wrote into the repo (naming rules, banned or already-tried tools, required checks before merge, preferred values, who owns what). Use before your first edit in a task, before you call a change done or ready to merge, before you recommend a tool, library, design or reviewer, before re-debugging an error that may already be solved, when they say 'didn't we fix this before', 'what did we decide about X' or 'I already have that', and before telling them something on this machine does not exist.
deja-reflect
End-of-session reflection and memory curation with deja-vu. Review what was decided, what commands broke and what repaired them, and record durable project rules or decisions with deja remember so the next session starts with them.
revid
Make, edit, export and post AI videos with Revid (revid.ai) through the Revid MCP server. Use whenever the user wants a short-form or long-form video made (from an idea, a script, a URL, an article, a PDF, a tweet, a product page, their own clips, or a song), wants to find what is going viral on TikTok, YouTube, Instagram or X before making something, wants to edit or re-export an existing Revid project, generate a standalone AI image or clip, make a series episode, or publish and schedule a finished video to connected social accounts. Covers setup (hosted MCP with OAuth, or an API key), the 36 tools, credits, polling and the rules for publishing. Routes to the more specific revid-* skills when one fits.