Files
stef-openclaw-skills/docs/web-automation.md
Luke a6dffe0091 Add general flow runner and document natural-language usage
- Add flow.ts for go/click/type/press/wait/screenshot flows
- Update web-automation docs with natural-language examples
- Update SKILL.md quick reference for flow.ts
- Remove temp script files
2026-02-11 22:01:38 +00:00

67 lines
1.7 KiB
Markdown

# web-automation
Automated web browsing and scraping using Playwright with Camoufox anti-detection browser.
## What this skill is for
- Automating web workflows
- Authenticated session flows (logins/cookies)
- Extracting page content to markdown
- Working with bot-protected or dynamic pages
## Requirements
- Node.js 20+
- `pnpm`
- Network access to download browser binaries
## First-time setup
```bash
cd ~/.openclaw/workspace/skills/web-automation/scripts
pnpm install
npx camoufox-js fetch
```
## System libraries (for OpenClaw Docker builds)
```bash
export OPENCLAW_DOCKER_APT_PACKAGES="ffmpeg jq curl libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2"
```
## Common commands
```bash
# Browse a page
npx tsx browse.ts --url "https://example.com"
# Scrape markdown
npx tsx scrape.ts --url "https://example.com" --mode main --output page.md
# Authenticate flow
npx tsx auth.ts --url "https://example.com/login"
# General natural-language browser flow
npx tsx flow.ts --instruction 'go to https://search.fiorinis.com then type "pippo" then press enter then wait 2s'
```
## Natural-language flow runner (`flow.ts`)
Use `flow.ts` when you want a general command style like:
- "go to this site"
- "find this button and click it"
- "type this and press enter"
### Example
```bash
npx tsx flow.ts --instruction 'go to https://example.com then click on "Sign in" then type "stef@example.com" in #email then press enter'
```
You can also use JSON steps for deterministic runs:
```bash
npx tsx flow.ts --steps '[{"action":"goto","url":"https://example.com"},{"action":"click","text":"Sign in"}]'
```