browser_dom
Extract structured JSON from page DOM with CSS selectors and field maps, including shadow roots, without executing JavaScript. Scope elements, resolve URLs, and skip empty rows for read-only scraping.
Instructions
Read-only DOM probe & structured JSON extractor (pierces shadow roots, zero eval). Pass 'fields' with 'selector' (e.g. { author: '.user', text: '.body', link: 'a@href', tags: '.tag[]', id: '@data-id' }); '.'=text, '@attr'=attr, '[]'=array. Resolves relative URLs & skips empty rows by default. Use within='' to scope.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "browser_dom"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Include ancestor matches for text search. | |
| tab | No | Tab index string (e.g. '0'), targetId, or URL/title substring. | |
| text | No | Visible text substring to match. | |
| exact | No | Exact text match. | |
| frame | No | Iframe #fN, id, URL substring, or 'any'. | |
| limit | No | Max matches (default 20). | |
| fields | No | Map of field -> DOM spec ('.', '@attr', '<css>', '<css>@<attr>', '[]'). | |
| within | No | Container CSS scope. | |
| max_text | No | Max chars per field (default 90 flat, 800 fields). | |
| selector | No | CSS selector (required with fields). | |
| dedupe_by | No | Deduplicate extracted items by this field name. | |
| skip_empty | No | Drop rows where all fields are empty (default true). | |
| resolve_urls | No | Resolve relative @href/@src to absolute URLs (default true). |