Skip to main content
Browser

Get an element's HTML

Get an element's HTML

Reads and returns an element's inner HTML from the browser's page. Use it when you need a component's complete HTML structure for later analysis or processing.


Options

Select the action

Where the element comes from.

By browser

Reads the element's inner HTML 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, div#result for example.

By element

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

Element ID

The action that captured the element whose inner HTML is read.

By element list

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

Element list ID

The action that captured the source list.

The list index

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

Returns

Javascript code

js
actions["action-id"].value // the element's inner HTML (Text)

Field selection

  • value — the element's inner HTML, every child tag included (Text)

Rules and conditions

  • Select the action has to be set before the other fields.
  • In By browser mode, Browser or page ID and Element selector are both required.
  • What comes back includes every child tag, preserving the inner DOM's full structure.
  • If the element is not found on the page, the action ends in an error.
  • If the element is empty, the return is an empty string.