webpage_get_attribute
Get one attribute (e.g. href, value, aria-label, data-*) of an element in the device browser page, by CSS selector or by a ref from a page-elements listing (iOS Safari or Android Chrome, auto-detected). value is null when the element exists but the attribute is absent. Throws only when the target itself does not resolve.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref from a page-elements listing, e.g. "e12". Provide this or `selector`. A ref points straight at the element it was issued for, so it survives markup that shifted position, and it can address elements no CSS selector can reach from the top of the page. | |
| name | Yes | Attribute name to read, e.g. "href", "value", "aria-label" | |
| udid | Yes | Device UDID / serial (iOS or Android) | |
| pageId | No | Target page/tab id — auto-picked when omitted | |
| socket | No | Android only: abstract unix socket name (default: chrome_devtools_remote) | |
| selector | No | CSS selector for the target element. Provide this or `ref`. | |
| platformVersion | No | Ignored (kept for compatibility) |