Files
ai-coding-skills/skills/web-automation/opencode/SKILL.md

38 lines
1.1 KiB
Markdown

---
name: web-automation
description: Browse and scrape web pages using Playwright with Camoufox anti-detection browser. Use when automating web workflows, extracting page content to markdown, handling authenticated sessions, or scraping websites with bot protection.
---
# Web Automation with Camoufox (OpenCode)
Automated web browsing and scraping using Playwright with Camoufox anti-detection browser.
## Requirements
- Node.js 20+
- pnpm
- Network access to download browser binaries
## First-Time Setup
```bash
# Use your OpenCode skills path
cd ~/.opencode/skills/web-automation/scripts
pnpm install
npx camoufox-js fetch
```
If native dependency build errors appear (e.g., better-sqlite3), rebuild from the reported package directory.
## Quick Reference
- Browse 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: `npx tsx auth.ts --url "https://example.com/login"`
## Notes
- Sessions persist in Camoufox profile storage.
- Use `--wait` for dynamic pages.
- Use `--mode selector --selector "..."` for targeted extraction.