Get Browser DOM
browser_get_domRetrieve the rendered HTML DOM of a web page or subtree to find CSS selectors, inspect element attributes, analyze page structure, and extract content for automation tasks.
Instructions
Get the HTML source code of the current page (or a scoped subtree). Returns the rendered DOM including dynamically loaded content. Use this to: find CSS selectors for browser_click/browser_type, understand page structure, check element attributes and classes, inspect form fields, or analyze the page content as HTML or plain text. For large pages, prefer browser_snapshot (accessibility-tree view) or scope with selector — a full-page dump can be tens of thousands of characters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Force a specific mode. Defaults to extension. | |
| format | No | "html" (default) returns markup. "text" strips tags and returns visible text only — much smaller for reading content. | |
| selector | No | CSS selector to scope the result to a single subtree instead of the whole page. Prefix with "pierce/" to reach into shadow DOM. | |
| maxLength | No | Truncate the returned dom string to this many characters. Omit for no limit (default). | |
| sessionId | No | Puppeteer session ID for headless mode. Skips mode selection. | |
| frameIndex | No | Read a specific iframe by index (from browser_frames) instead of the main page. |