extract_fields
Extract structured data from a live authenticated browser as JSON using CSS selectors, with support for arrays, attributes, and HTML content.
Instructions
Declarative STRUCTURED extract: pass a {name: selector} map and get back ONE JSON object of values in a single call — against our real authenticated Chrome DOM (a login-walled / SPA page stateless scrapers can't reach). Grammar: name[]=array, sel@attr=attribute, sel@html=innerHTML, bare=text. Optional target scopes selectors to a subtree. Returns {fields, matched, misses, errors} — misses/errors let you fix a selector without re-reading the page. Reads text/attr/innerHTML only, never input values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lease | No | Optional lease token to present if the target session is leased (0.7.0). Threaded per-call; never read from the server's env. | |
| fields | Yes | Map of field name → CSS selector (with optional @attr / @html / name[] array suffix). | |
| target | No | Optional @eN / @text: / @label: / CSS root to scope all selectors to a subtree. | |
| session | No | Optional session name to target (omit for the shared 'default'). On a daemon shared with other agents, pass a UNIQUE name for stateful multi-step work (go→click→fill) so you don't collide on 'default'. | |
| node_cap | No | Cap nodes read per array field. | |
| max_chars | No | Cap each field value's length. |