Browser Automation
Overview
Automate browser interactions: navigate pages, click elements, fill forms, take
screenshots, extract data. Use whatever browser automation tool is available in
your environment (e.g., playwright-cli, Playwright MCP, WebFetch, curl).
Instructions
Detect Tool
- Check what browser tools are available. Prefer full browser (JS rendering, interaction) over HTTP-only tools.
- If no browser tool is found, fall back to
WebFetchorcurlfor read-only page access. Inform the user about limitations.
Navigate
- Open the target URL. Wait for the page to load.
Observe Before Acting
- Always capture page state (accessibility snapshot, DOM, or HTML) before interacting. Use structured data (accessibility tree, element refs) over raw screenshots when possible — structured data is better for reasoning.
Interact
- Click, fill, type, select using element references from the snapshot.
- After each interaction, re-capture page state to verify the result.
Capture Output
- Take screenshots or extract data as requested.
- Save files to the working directory.
Clean Up
- Close browser sessions when finished.
Best Practices
- Snapshot First: Always capture page state after navigation or interaction before taking next action.
- Isolation: Use separate sessions for independent tasks.
- Clean Up: Always close browser sessions when done.
- Prefer Structured Data: Accessibility snapshots > screenshots > raw HTML for element identification.