# Read element data

Node type `browser_getElement`

## What it does

Read text, HTML, or a named attribute from one or more matched elements.

## Desktop client configuration

![Read element data configuration in the desktop client](/assets/get-element.82353332a27b2e6642fd4415f67643de4e56d5a746cdd0b78d45b21816b4abc8.0538f3a9.webp)

Captured in the English interface of MoreLogin Desktop V2.73.101.

## Inputs

These fields belong in `data.browserUi.inputs`.

| Field | Type or values | Schema required | Execution default | Description and bounds |
|  --- | --- | --- | --- | --- |
| `selectorType` | `"selector"` / `"element"` / `"frame"` (supports variable references) | No | `"selector"` | Element source. Editor initial value `"selector"` |
| `frame` | `string` | No | — | iframe variable |
| `element` | `string` | No | — | Element variable |
| `selectorRadio` | `"CSS"` / `"XPath"` (supports variable references) | No | `"CSS"` | Selector type. Editor initial value `"CSS"`. For example, `"${locatorType}"`; the referenced value must be `"CSS"` or `"XPath"`. |
| `selector` | `string` | No | — | Selector |
| `outputRange` | `"single"` / `"all"` (supports variable references) | No | `"single"` | When multiple element objects match. Editor initial value `"single"` |
| `serialType` | `"fixed"` / `"randomInterval"` (supports variable references) | No | `"fixed"` | When multiple element objects match. Editor initial value `"fixed"` |
| `serial` | `WorkflowNumber` | No | `1` | Element index; integer; minimum after resolution: 1. Editor initial value `1` |
| `serialMin` | `WorkflowNumber` | No | — | Minimum index; integer; minimum after resolution: 1 |
| `serialMax` | `WorkflowNumber` | No | — | Maximum index; integer; minimum after resolution: 1 |
| `type` | `"innerText"` / `"innerHTML"` / `"attribute"` (supports variable references) | No | `"innerText"` | Output type. Editor initial value `"innerText"` |
| `key` | `string` | No | — | Attribute name / child element selector |


## Mode requirements and limits

- **Locator rules:** selectorType=selector requires selector; frame requires frame+selector; element requires an ElementRef reference from a previous node. serial starts at 1. randomInterval uses serialMin/serialMax, and the minimum cannot be greater than the maximum. The node first waits for the selector to match elements, then picks the index once: the upper bound of the range is capped at the actual match count. If a fixed index or the lower bound of the range is greater than the match count, ELEMENT_NOT_FOUND (reason=range, details.field is serial or serialMin) is returned immediately and the page is not touched.
outputRange can only be single/all. type can only be innerText/innerHTML/attribute (the same as the editor; use getElementRef for element objects and getFrame for iframes), and type=attribute requires key (the attribute name). Read the returned keys and values as a single value or an array according to the branch. The node does not wait for the element to appear: if nothing is found, it succeeds immediately, a single value is the empty string "" (all is []), and a missing attribute is "". If you need to wait, use "Wait for element" first.
- Validation code `RPA_NODE_INPUT_INVALID`


## Input references

| Field | Allowed forms |
|  --- | --- |
| `selectorType` | `literal`, `template` |
| `frame` | `literal`, `template` |
| `element` | `literal`, `template` |
| `selectorRadio` | `literal`, `template` |
| `selector` | `literal`, `template` |
| `outputRange` | `literal`, `template` |
| `serialType` | `literal`, `template` |
| `serial` | `literal`, `numericExpression` |
| `serialMin` | `literal`, `numericExpression` |
| `serialMax` | `literal`, `numericExpression` |
| `type` | `literal`, `template` |
| `key` | `literal`, `template` |


## Outputs

**Mode** `{"op":"and","rules":[{"op":"eq","field":"type","value":"innerText"},{"op":"eq","field":"outputRange","value":"single"}]}`

| Output field | Type or values |
|  --- | --- |
| `text` | `string` |
| `matchedCount` | `number` |


**Mode** `{"op":"and","rules":[{"op":"eq","field":"type","value":"innerText"},{"op":"eq","field":"outputRange","value":"all"}]}`

| Output field | Type or values |
|  --- | --- |
| `text` | array<`string`> |
| `matchedCount` | `number` |


**Mode** `{"op":"and","rules":[{"op":"eq","field":"type","value":"innerHTML"},{"op":"eq","field":"outputRange","value":"single"}]}`

| Output field | Type or values |
|  --- | --- |
| `html` | `string` |
| `matchedCount` | `number` |


**Mode** `{"op":"and","rules":[{"op":"eq","field":"type","value":"innerHTML"},{"op":"eq","field":"outputRange","value":"all"}]}`

| Output field | Type or values |
|  --- | --- |
| `html` | array<`string`> |
| `matchedCount` | `number` |


**Mode** `{"op":"and","rules":[{"op":"eq","field":"type","value":"attribute"},{"op":"eq","field":"outputRange","value":"single"}]}`

| Output field | Type or values |
|  --- | --- |
| `attribute` | `string` / `null` |
| `matchedCount` | `number` |


**Mode** `{"op":"and","rules":[{"op":"eq","field":"type","value":"attribute"},{"op":"eq","field":"outputRange","value":"all"}]}`

| Output field | Type or values |
|  --- | --- |
| `attribute` | array<`string` / `null`> |
| `matchedCount` | `number` |


Reference published fields as `${nodeId.data.field}`.

## JSON example

This example reads the text of the first element that matches `.price` into `data.text`. Add Wait for element first if the element loads asynchronously.

```json
{
  "id": "read_price",
  "type": "browser_getElement",
  "data": {
    "title": "Read the product price",
    "browserAction": "getElement",
    "browserUi": {
      "inputs": {
        "selectorType": "selector",
        "selectorRadio": "CSS",
        "selector": ".price",
        "outputRange": "single",
        "serialType": "fixed",
        "serial": 1,
        "type": "innerText"
      },
      "exception": {
        "timeout": 30000,
        "policy": "interrupt"
      }
    }
  }
}
```

[Back to the node catalog](/browser-rpa/nodes)