Skip to main content
Roberty Studio
RPABrowser

Get Element Attribute

Get Element Attribute

Reads and returns the value of an element's HTML attribute on the browser's page. It can give you the inner text, the inner HTML, or any other attribute such as href, class or src.


Options​

Select the action​

Where the element comes from.

An element in the browser​

Reads the element's attribute using a CSS selector.

Browser or page ID​

The browser, tab or iframe opening action the element is in.

Element selector​

The CSS selector identifying the element on the page, a#downloadLink for example.

An element already selected​

Reads the attribute of an element captured earlier by a Get element action.

Element ID​

The action that captured the element whose attribute is read.

One item from a selection of multiple elements​

Reads the attribute of an element from a list captured by a Get elements action.

Elements list id​

The action that captured the source list.

Enter the index of the list​

The element's position in the list. The index starts at 0.

Attribute​

How the attribute to read is given:

  • commonValue — shows a second Attribute field with the most frequent options (default)
  • Manual value — to read another HTML attribute of the element

Attribute​

Available when the previous field is set to commonValue. The attribute to read: InnerHTML - Object HTML (the inner HTML content) or InnerText - Text of an HTML object (the visible text, no markup). The robot also accepts the name of any other attribute of the element, such as href, class or data-id.

Returns​

Javascript code​

js
actions["action-id"].value // the value of the HTML attribute read (Text)

Field selection​

  • value — the value of the HTML attribute read from the element (Text)

Rules and conditions​

  • Select the action has to be set before the other fields.
  • In An element in the browser mode, Browser or page ID and Element selector are both required.
  • InnerHTML returns the element's inner HTML. InnerText returns only the visible text, with no markup.
  • If the attribute does not exist on the element, the return is empty.