Skip to content

Get Attribute

Type: page-get-attribute  ·  Package: Browser v1.0.0  ·  Output: string

Reads the value of an element’s HTML attribute. It is used to extract data that is not visible text: the download link of a button (href), the URL of an image (src), a hidden identifier (data-id), or the state of an element (class, disabled).

Locate the element by its selector and return the value of the attribute whose name you indicate in attribute. If the attribute does not exist, it returns empty.

ParameterEditorDescription
selectorselectorThe element to read the attribute from.
attributetextNombre del atributo HTML. Ej: href, src, data-id, class.
ParameterEditorDescription
pagesessionThe page session. Omit it inside a body; outside, pass = page.
timeoutnumberMaximum ms to wait for the element. By default 30000.

Returns a string with the attribute value.

Get the download link for a document:

Page Get Attribute selector = (#enlaceFactura) attribute = "href" → output: urlPdf
Log message = = "URL del PDF: " + urlPdf
  • Get Text — read visible text instead of an attribute.
  • Get Value — read the value of a form field.