page.extract_text
Extract readable text from a browser page or a specific element via CSS selector, XPath, or snapshot ref; target a single panel instead of the full page.
Instructions
Readable text of the page, or of one element when given a locator. Pass selector/ref to read a single panel instead of the whole page.
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": "page.extract_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nth | No | Zero-based index when the locator matches several elements. | |
| ref | No | Snapshot ref (eNN) from page.snapshot. | |
| text | No | Visible text of the element. | |
| xpath | No | XPath expression. | |
| frame_id | No | Frame to search within; see page.list_frames. | |
| selector | No | CSS selector; pierces shadow DOM. | |
| max_chars | No | ||
| target_id | No | Target handle (tgt_*). Omit for the active page. | |
| browser_id | No | Browser handle (br_*). Omit to use the only running browser, or auto-launch one. | |
| visible_only | No | Skip visually-hidden (sr-only, clipped, off-screen) text that innerText still reports. Use on marketing pages whose first 1500 characters are an invisible SEO block. | |
| include_hidden | No | ||
| backend_node_id | No | CDP backendNodeId, e.g. from inspector.pick. |