Get Web Element
Command description
Retrieve a specified web element and access its coordinates, dimensions, attributes, source code, and other information. Use Get Related Web Elements to retrieve its parent, children, siblings, or descendants.
For example, you can directly use the following Python expression to obtain relevant data:
| Python expression | Description |
|---|---|
webElement.innerText | innerText of the JavaScript HTMLElement |
webElement.href | href of the JavaScript HTMLElement |
webElement.src | src of the JavaScript HTMLElement |
webElement.textContent | textContent of the JavaScript HTMLElement |
webElement.value | value of the JavaScript HTMLElement |
webElement.checked | checked of the JavaScript HTMLElement |
webElement.selected | selected of the JavaScript HTMLElement |
webElement.left | Physical-pixel distance from the left edge of the screen to the element's left edge; reading it activates the corresponding webpage and brings its browser window to the front |
webElement.top | Physical-pixel distance from the top edge of the screen to the element's top edge; reading it activates the corresponding webpage and brings its browser window to the front |
webElement.right | Physical-pixel distance from the left edge of the screen to the element's right edge; reading it activates the corresponding webpage and brings its browser window to the front |
webElement.bottom | Physical-pixel distance from the top of the screen to the bottom edge of the element; reading it activates the corresponding webpage and brings its browser window to the front |
webElement.width | Element width in physical pixels; reading it activates the corresponding webpage and brings its browser window to the front |
webElement.height | Element height in physical pixels; reading it activates the corresponding webpage and brings its browser window to the front |
For other webElement properties, refer to the WebElement class definition.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Webpage Object | WebPage | Get the elements of this web page |
| Web Element | str | Captured web element UID, not its name or ms-rpa-id |
| Element Wait Duration | number | Maximum time to wait for the element to appear, in seconds |
Command Output Parameters
| Output parameters | Output parameter type | Description |
|---|---|---|
| Web Element | WebElement | Retrieved element object. Reading its coordinate or size properties activates the webpage and brings its browser window to the front. |
Type definition reference
tip
- Runavelo has a powerful type management mechanism that can directly obtain relevant information through objects without resorting to other commands. This mechanism can significantly simplify the process complexity.
- Install the Runavelo browser extension before using this command.
- See Capture Web Elements for instructions on capturing elements and editing their attributes.
- If the required element has not been captured, the AI can call the
start_capture_web_elementtool.
Example
-
Runavelo obtains the href link in
<a href='/xxx'> -
Other RPA software obtains href links in
<a href='/xxx'>
Runavelo lets you access element information directly without additional commands. This reduces the number of intermediate objects and keeps workflows simpler and clearer.