68 lines
1.9 KiB
Markdown
68 lines
1.9 KiB
Markdown
# WEB-AUTOMATION
|
|
|
|
## Purpose
|
|
|
|
Automate browsing and scraping with Playwright + Camoufox.
|
|
|
|
## Requirements
|
|
|
|
- Node.js 20+
|
|
- pnpm
|
|
- `playwright-core`
|
|
- `camoufox-js`
|
|
- Network access to download Camoufox browser artifacts
|
|
|
|
## Install
|
|
|
|
### Codex
|
|
|
|
```bash
|
|
mkdir -p ~/.codex/skills/web-automation
|
|
cp -R skills/web-automation/codex/* ~/.codex/skills/web-automation/
|
|
cd ~/.codex/skills/web-automation/scripts
|
|
pnpm install
|
|
pnpm add playwright-core camoufox-js
|
|
npx camoufox-js fetch
|
|
```
|
|
|
|
### Claude Code
|
|
|
|
```bash
|
|
mkdir -p ~/.claude/skills/web-automation
|
|
cp -R skills/web-automation/claude-code/* ~/.claude/skills/web-automation/
|
|
cd ~/.claude/skills/web-automation/scripts
|
|
pnpm install
|
|
pnpm add playwright-core camoufox-js
|
|
npx camoufox-js fetch
|
|
```
|
|
|
|
### OpenCode
|
|
|
|
```bash
|
|
mkdir -p ~/.config/opencode/skills/web-automation
|
|
cp -R skills/web-automation/opencode/* ~/.config/opencode/skills/web-automation/
|
|
cd ~/.config/opencode/skills/web-automation/scripts
|
|
pnpm install
|
|
pnpm add playwright-core camoufox-js
|
|
npx camoufox-js fetch
|
|
```
|
|
|
|
## Verify Installation & Dependencies
|
|
|
|
Run in the installed `scripts/` folder:
|
|
|
|
```bash
|
|
node -e "require.resolve('playwright-core/package.json');require.resolve('camoufox-js/package.json');console.log('OK: playwright-core + camoufox-js installed')"
|
|
node -e "const fs=require('fs');const t=fs.readFileSync('browse.ts','utf8');if(!/camoufox-js/.test(t)){throw new Error('browse.ts is not configured for Camoufox')}console.log('OK: Camoufox integration detected in browse.ts')"
|
|
```
|
|
|
|
If checks fail, stop and return:
|
|
|
|
"Missing dependency/config: web-automation requires `playwright-core` + `camoufox-js` and Camoufox-based scripts. Run setup in this skill, then retry."
|
|
|
|
## Usage Examples
|
|
|
|
- Browse: `npx tsx browse.ts --url "https://example.com"`
|
|
- Scrape: `npx tsx scrape.ts --url "https://example.com" --mode main --output page.md`
|
|
- Auth: `npx tsx auth.ts --url "https://example.com/login"`
|