Skip to main content
[Command] Get web element attribute
Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

The Get web element attribute command is used to instruct the workflow to get attributes of an element on a web page, such as getting href, value, text, index, etc.


Parameters Values

Set parameters

Parameter

Definition

Web page

Select a target web page. There are 2 commands that can be used to generate a web page variable:

  • Go to web page

  • Find web page

Element

Select the element to get its attribute by capturing a new element or selecting from a previously saved element

Attribute

Select a type of attribute to proceed

  • Text

  • Source code

  • Value

  • Href

  • Index

  • Other attributes

Save attribute as

Name the variable generated by the parameters above

Advanced settings

Parameter

Definition

Wait for element

Wait for a specified amount of time (seconds) until the element appears

Error handling

Parameter

Definition

When error occurs

Select the action to be performed when an error occurs

  • Terminate the project

  • Ignore the error and execute the next command

  • Retry action


Example

The workflow will open a new tab, enter https://rpa.octoparse.com/pricing in Chrome, save the web page as a variable named "RPA_price_page", get href and text attributes of the target element named "A pricing" which is obtained with +Capture from the webpage "PRA_price_page", and save them as "Href_A_of_Pricing" and "Text_of_A_Pricing" respectively, and display a message with "Text_of_A_Pricing" as the title and "Href_A_of_Pricing" as the content.

Did this answer your question?