browser_get_attribute
Retrieve a specific HTML attribute value from a page element using its snapshot reference. Get href, value, aria-label, or custom data attributes without fetching a full snapshot.
Instructions
Read a single HTML attribute from an element referenced by snapshot ref. Use attr: 'href' to get a link's URL (e.g. extract a Stripe payment link from a share button), attr: 'value' for current input values, attr: 'aria-label' for accessibility text, or any custom data-* attribute. Returns the attribute value as a string, or an empty string if the attribute is not set. Cheaper and more precise than a full snapshot when you need one specific value.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Exact target element reference from the page snapshot | |
| attr | Yes | The HTML attribute name to read (e.g. 'href', 'value', 'aria-label', 'data-testid') | |
| tabId | No | Optional tab ID to target. When omitted, routes to the agent's active tab. Use browser_list_tabs to see available tab IDs. | |
| element | Yes | Human-readable element description used to obtain permission to interact with the element |