Skip to main content
Roberty Studio
RPABrowser

Get an HTML attribute

Get an HTML attribute

Reads and returns the value of one particular HTML attribute of an element on the browser's page, with the attribute's name given by hand. Useful for pulling out href, src, class, data-id and the like.


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, img.logo 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​

The exact name of the HTML attribute to read from the element — src, href or data-id, for example.

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.
  • Attribute takes any standard HTML attribute: href, src, class, name, id and data-*.
  • If the attribute does not exist on the element, the return is empty.