get_attribute
Read an HTML attribute value from a selected element to retrieve href, src, value, data, or ARIA properties in the live DOM.
Instructions
Get an HTML attribute value from an element. Returns the attribute value. When to use: to read href, src, value, data attributes, or ARIA properties from an element. Related: get_text (read element text content), get_dom_snapshot (find element selectors). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab_id | No | Optional. Tab id this read targets. Omit when the calling agent owns exactly one tab; required to disambiguate when the agent owns multiple. Single-tab agents and legacy popup/sidepanel/autopilot do not need to pass this. | |
| selector | Yes | CSS selector or element ref (e.g., "#link", "a.nav-item", or "e7" from get_dom_snapshot) | |
| attribute | Yes | HTML attribute name (e.g., 'href', 'src', 'value') |