webpage_get_dom
Get the rendered outer HTML of the web page open in the device browser — works on BOTH iOS (Safari, via the Web Inspector) and Android (Chrome, via CDP); the platform is auto-detected from the udid. Returns document.documentElement.outerHTML, or the outerHTML of a CSS-selector-matched element when selector is given. On iOS, Safari is launched automatically if it is not already open. Output is capped at 100 000 characters with a truncation notice. This is web-page HTML — for a NATIVE app UI hierarchy use device_page_source (Android) or ios_page_source (iOS).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Device UDID / serial (iOS or Android) | |
| pageId | No | Target page/tab id — auto-picked when omitted (iOS: appIdKey.pageIdKey; Android: CDP target id) | |
| socket | No | Android only: abstract unix socket name (default: chrome_devtools_remote) | |
| selector | No | Optional CSS selector — returns outerHTML of the first matching element, or null | |
| platformVersion | No | iOS only: platform version for the remote debugger (default: 17.0) |