*** title: locator.getAttribute description: Read an attribute from the matched element. -------------------------------------------------------- `locator.getAttribute` is a browser runtime capability in the `locator` namespace. ## Availability * Runtime: `browser` * Kind: `raw` * Category: `extraction` * Supported drivers: Playwright, Puppeteer ## SDK Surface * SDK path: `runtime.page.locator(...).getAttribute` * Async: Yes ## HTTP Surface * Transport: `workspace.execute(...)` * Call: `locator.getAttribute` * Long-running: No ## Reference Semantics * Requires refs: `locator` ## Arguments | Argument | Type | Required | Description | | -------- | -------- | -------- | --------------- | | `name` | `string` | Yes | Attribute name. | ## Result * Type: `string | null` * Description: Attribute value if present. ## SDK Example ```ts await runtime.page.locator('button[type=submit]').getAttribute('href'); ``` ## HTTP Example ```json { "runtime": "crm", "steps": [ { "call": "locator.getAttribute", "args": [ "href" ] } ] } ``` ## Related Capabilities * [`locator.innerText`](../extraction/locator-inner-text) * [`locator.textContent`](../extraction/locator-text-content)