To automate web browsing:
Starting a Session:
- •Use
browser_open_url("https://example.com")to navigate - •This returns page title and interactive elements
- •The browser auto-starts if not already running
Interacting with Pages:
- •
browser_click("selector")- Click element by CSS selector or text- •CSS:
browser_click("button.submit") - •Text:
browser_click("text=Login")
- •CSS:
- •
browser_type("selector", "text")- Type into input field- •
browser_type("input[name='q']", "search query")
- •
Reading Content:
- •
browser_get_content()- Extract page text for analysis - •
browser_screenshot()- Capture page as image
Ending Session:
- •
browser_close()- Close browser and cleanup
Workflow Example:
- •
browser_open_url("https://google.com")→ Opens Google - •
browser_type("input[name='q']", "weather today")→ Type search - •
browser_click("text=Google Search")→ Submit search - •
browser_get_content()→ Read results
[!TIP] Use the interactive elements list from
browser_open_urlto find selectors.