browser_extract
Extract structured records from the current browser page using CSS selectors, including repeated items, attributes, and numeric fields; optionally save results as JSON or CSV.
Instructions
Extract structured data from the current page. Give itemSelector (one element per record, e.g. ".product") and fields relative to each item, e.g. {"name": "h2", "price": {"selector": ".price", "type": "number"}, "url": "a@href", "image": "img@src"}. Without itemSelector, fields are read once from the whole page.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"fields": "<fields>"
},
"name": "browser_extract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max items (default 1000). | |
| tabId | No | Tab to act on. Defaults to the tab last opened/selected by an agent, else the active tab. | |
| fields | Yes | Map of output field -> spec. Spec is a CSS selector string relative to each item ("h2", "a.title@href" to read an attribute, "." for the item itself) or an object {selector, attr: "text"|"html"|"href"|"src"|"value"|<attribute>, all: bool (return every match as an array), type: "number", regex: "capture (group)"}. | |
| savePath | No | Save results as .json or .csv. | |
| itemSelector | No |