Get the property value of a web page element
1. Component introduction
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
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
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
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.Use the Capture control feature to capture an element on the web page. Name the captured element `Control 1`.
For
Target control, select `Control 1`.For
Property value, enter `class`.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
Use the Get opened web page component to select the Baidu page in Google Chrome.
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.
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.