Dexter Browser Automation
by @tylerdotai
Browser automation via Playwright. Use when pages are JS-rendered, require user interaction (click/fill), or need screenshots. Part of the 3-layer web tool h...
clawhub install dex-browserπ About This Skill
name: browser-automation description: "Browser automation via Playwright. Use when pages are JS-rendered, require user interaction (click/fill), or need screenshots. Part of the 3-layer web tool hierarchy: search (SearXNG) β extract (web_fetch) β interact (browser). This is the last resort layer."
Browser Automation
When to Use This Skill
Trigger conditions:
web_fetch returned empty, garbled, or incomplete contentDo NOT use this skill when:
web_fetch is fasterweb_search is the right first stepThe 3-Layer Web Tool Hierarchy
Layer 1 β Search: web_search β find URLs
Layer 2 β Extract: web_fetch β get page content (static pages only!)
Layer 3 β Interact: browser.py β JS rendering, interaction, screenshots
Always try Layer 1 and 2 before reaching for browser automation.
Setup Check
python3 skills/browser-automation/scripts/init.py
Should return {"ready": true}. If not, Playwright needs installation.
Scripts
All scripts exit with code 0 on success, 1 on usage error, 2 on browser error.
screenshot.py β Capture a page
python3 skills/browser-automation/scripts/screenshot.py [path]
Default path: /tmp/screenshot.png
Returns: {success, saved, title}
scrape.py β Get rendered HTML
python3 skills/browser-automation/scripts/scrape.py
Returns: {success, title, url, html} (html truncated to 50k chars)
extract.py β Pull structured data
python3 skills/browser-automation/scripts/extract.py
CSS selector targets elements. Extracts up to 50 elements, each with text, href, src, alt.
Returns: {success, count, selector, items[]}
interact.py β Click and fill
# Click
python3 skills/browser-automation/scripts/interact.py click [url]Fill input
python3 skills/browser-automation/scripts/interact.py fill [url]Hover
python3 skills/browser-automation/scripts/interact.py hover [url]
If url is provided, navigates there first. Returns: {success, action, selector, title, url}
Reference Docs
references/selectors.md β CSS selector syntax and common patternsreferences/patterns.md β Login flows, search pagination, infinite scroll, stealth mode, error recoveryExamples
JS-rendered page (would fail web_fetch)
# web_fetch gives nothing on HN β use extract
python3 scripts/extract.py "https://news.ycombinator.com" ".titleline > a"
Screenshot a page
python3 scripts/screenshot.py "https://site.com/dashboard" "/tmp/dashboard.png"
Form login flow
python3 scripts/interact.py fill "#username" "user@example.com" "https://site.com/login"
python3 scripts/interact.py fill "#password" "secret123"
python3 scripts/interact.py click "button[type=submit]"
python3 scripts/scrape.py "https://site.com/dashboard"
Get structured data from a list
python3 scripts/extract.py "https://jobs.site.com/postings?q=engineer" ".job-listing h2"
Quick Reference
| Task | Command |
|---|---|
| Screenshot | screenshot.py |
| HTML | scrape.py |
| Data | extract.py |
| Click | interact.py click |
| Fill | interact.py fill |
| Setup check | init.py |
Skill Metadata
init.py, screenshot.py, scrape.py, extract.py, interact.pyselectors.md, patterns.mdpip install playwright && playwright install chromium)π‘ Examples
JS-rendered page (would fail web_fetch)
# web_fetch gives nothing on HN β use extract
python3 scripts/extract.py "https://news.ycombinator.com" ".titleline > a"
Screenshot a page
python3 scripts/screenshot.py "https://site.com/dashboard" "/tmp/dashboard.png"
Form login flow
python3 scripts/interact.py fill "#username" "user@example.com" "https://site.com/login"
python3 scripts/interact.py fill "#password" "secret123"
python3 scripts/interact.py click "button[type=submit]"
python3 scripts/scrape.py "https://site.com/dashboard"
Get structured data from a list
python3 scripts/extract.py "https://jobs.site.com/postings?q=engineer" ".job-listing h2"