act
Automate browser interactions like clicking, typing, and selecting to access data behind dynamic elements, then extract structured information.
Instructions
Drive a real Chromium through a sequence of steps, then run Sonnet structured extraction on the final state.
Use this when the data is BEHIND an interaction — a Year/Month dropdown
that fires AJAX inline, a tab to click, a "Load more" button, a form
to submit. visit and extract only read the page as it loaded;
act clicks/types/selects first.
Steps are a list of single-key dicts: {"click": "css-selector"} {"fill": {"selector": "#q", "value": "x"}} {"select": {"selector": "#year", "value": "2024-2025"}} {"press": {"selector": "#q", "key": "Enter"}} {"scroll": {"to": "bottom"|"top"|}} {"wait_for_selector": "css-selector"} {"wait_for_load_state": "networkidle"|"load"} {"wait_ms": 1500} {"goto": "https://…"} // mid-flow navigation {"screenshot": {"name": "after-select"}} // logged, not returned
Example — pull PPAC FY2024-25 monthly consumption (a flow that needs the year dropdown change to fire an AJAX request): act( url="https://ppac.gov.in/consumption/products-wise", steps=[ {"wait_for_selector": "#financialYear"}, {"select": {"selector": "#financialYear", "value": "2024-2025"}}, {"wait_for_load_state": "networkidle"}, {"wait_ms": 2000}, ], focus="FY2024-25 monthly LPG, MS, HSD, ATF consumption", )
Returns the same shape as extract PLUS step_results (per-step
timing + ok/error) and final_url.
Args: url: Starting page URL. steps: Ordered list of action dicts (vocabulary above). focus: Extraction focus passed to Sonnet. timeout_ms: Per-step navigation / wait timeout. full_page_screenshot: Whether the final screenshot is full-page.
Returns: {url, domain, title, dateline, summary, key_facts[], numeric_values[], dates[], tables_summary[], step_results[], final_url, kind: "browser"}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| steps | Yes | ||
| focus | No | ||
| timeout_ms | No | ||
| full_page_screenshot | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||