Get the property value of a web page element

Updated at:

1. Component introduction

Note

Prerequisites: Open new web page or Get opened web page

This component retrieves the value of a specific property of an HTML tag. It can be used with target controls on web pages in Google Chrome, Microsoft Edge, and Internet Explorer.

2. Input items

Note

For more information about the input parameters, see the description of each parameter in the component panel of the ROS Visual Editor.

3. Output items

Note

For more information about the output parameters, see the description of each parameter in the component panel of the ROS Visual Editor.

4. Component usage example

4.1. Component configuration example

  1. For Opened browser object, select `v_web_obj_1`, which is the output variable from the Open new web page or Get opened web page component.

  2. Use the Capture control feature to capture an element on the web page. Name the captured element `Control 1`.

  3. For Target control, select `Control 1`.

  4. For Property value, enter `class`.

  5. Keep the default settings for the advanced options.

4.2. Example execution result

The component retrieves the property value of the HTML tag for the specified element on the Baidu page in Google Chrome. The result is saved to the default variable `v_web_element_value_1`.

5. Flow creation example

Deployment flow

  1. Use the Get opened web page component to select the Baidu page in Google Chrome.

  2. Use the Get property value of a web page element component to retrieve the value of the `class` property of the HTML tag for a specific element.

  3. Use the Show message box component to display the retrieved value.

Execution result

The flow runs and displays the value of the `class` property of the HTML tag for the captured element in a message box, as shown in the following figure.