get_attributes
Retrieve HTML attribute values such as href, src, class, or data-* from a matching element. Specify a selector and optional attribute to get one value or all attributes as a dictionary.
Instructions
Read HTML attributes from a matching element.
Use this tool when you need the value of one or more HTML attributes such as href, src, value, class, id, name, type, aria-label, or data-*.
Args: selector: CSS selector or SeleniumBase text-matching selector for the target element. attribute: Specific HTML attribute to retrieve. When omitted, return all HTML attributes of the element as a dictionary.
Returns: The requested attribute value, or a dictionary containing all HTML attributes of the element when attribute is omitted.
Tool selection: - Need one or more HTML attribute values from a specific element -> use this tool. - Need to discover multiple matching elements or inspect their text -> use 'find_elements'. - Need visible text or HTML content -> use 'get_content'. - Need to check presence or visibility -> use 'check_for_condition'.
This is a read-only operation and does not modify the element.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | ||
| attribute | No |