Get Value
Gets the value of the selected element from a web page.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Page Id - Id of the opened browser page as provided by Open Browser node. This ID is generated by the Open Browser node.
- Selector Type - Type of selector used to locate the element (XPath or CSS).
- Selector - The selector used to locate the element.
- Attribute - The attribute of the element that holds the desired value.
Output
- Value - The value of the selected element.
Options
- Wait Timeout (sec) - Maximum time in seconds for the node to wait for the element to appear on the page.
Notes
- The Page Id must be provided by a previously executed Open Browser node
- The Attribute field is optional. If not provided, the inner text of the selected element will be returned.
info
If you want to get an Image URL from an img element, you need to write src into the Attribute input or if you want to get the link of an a element you need to write href into the Attribute input.
How It Works
- The node receives the Page ID, Selector Type, Selector, and optional Attribute
- It validates that the Page ID and Selector are not empty
- It waits for any configured delay before execution
- It retrieves the active page session using the provided Page ID
- The node waits for the element to appear on the page (up to the Wait Timeout duration)
- For Safari browsers, it uses JavaScript execution to get the element value
- For other browsers, it locates the element using the provided selector
- Based on the configuration, it extracts the value:
- If Attribute is specified: Returns the value of that attribute
- If element is input or textarea and no attribute specified: Returns the "value" attribute
- Otherwise: Returns the inner text of the element
- The extracted value is stored in the output variable
- The node applies any configured delay after execution
Requirements
- An active browser session created by the Open Browser node
- A valid Page ID from the Open Browser node
- A valid CSS or XPath selector that uniquely identifies the target element
- The target element must exist and be visible on the page within the Wait Timeout period
Error Handling
| Error Code | Description |
|---|---|
| Core.CSV.AppendCSV.ErrOnCreate | Configuration parsing error during node creation |
| Core.Browser.GetValue.OnMessage | Error parsing incoming message data |
| Core.Browser.GetValue.ErrPageId | Page ID is empty or not provided |
| Core.Browser.GetValue.ErrSelector | Selector is empty or not provided |
| Core.Browser.GetValue.ErrSession | Invalid or expired Page ID, session not found |
| Core.Browser.GetValue.InvalidField | Invalid value for Wait Timeout field |
| Core.Browser.GetValue.WaitElement | Element not found within the specified timeout period |
| Core.Browser.GetValue.ErrForward | Failed to execute script (Safari) |
| Core.Browser.GetValue.ErrElements | Failed to retrieve element from selection |
| Core.Browser.GetValue.ErrGetName | Failed to get element tag name |
| Core.Browser.GetValue.ErrAttribute | Failed to retrieve attribute value |
| Core.Browser.GetValue.ErrText | Failed to retrieve element text |
| Core.Browser.GetValue.ErrOutputMarshal | Error serializing output value |
Usage Examples
Example 1: Extracting Product Price
When scraping product information from an e-commerce site:
1. Use Open Browser and navigate to product page
2. Use Get Value with:
- Selector Type: CSS
- Selector: .product-price
- Attribute: (leave empty to get text)
- Wait Timeout: 10 seconds
3. Store the price in a variable (productPrice)
4. Use the extracted price for comparison or storage
Example 2: Getting Image URLs
When extracting image sources from a page:
1. Use Open Browser and navigate to the target page
2. Use Get Value with:
- Selector Type: XPath
- Selector: //img[@class='product-image']
- Attribute: src
- Wait Timeout: 5 seconds
3. The output contains the full image URL
4. Use the URL to download or reference the image
Example 3: Reading Input Field Values
When validating form data or reading pre-filled values:
1. Navigate to a form page
2. Use Get Value with:
- Selector Type: CSS
- Selector: input[name="email"]
- Attribute: (leave empty for automatic value extraction)
- Wait Timeout: 5 seconds
3. The node automatically retrieves the "value" attribute for input fields
4. Validate or use the extracted value in your automation
Usage Notes
- If Attribute is not specified, behavior depends on element type:
- Input/textarea elements: Returns the "value" attribute
- Other elements: Returns the inner text
- The node automatically waits for elements to appear before extraction
- For Safari browsers, value extraction uses JavaScript, which may have different behavior
- Attribute names are case-sensitive (use "src" not "SRC")
- Common attributes: href, src, alt, title, class, id, data-, aria-
- For hidden elements, the value can still be retrieved if the element exists in the DOM
- Empty strings are returned if the element exists but has no value/text
Tips
- Use browser developer tools to identify correct attribute names
- Increase Wait Timeout for elements that load slowly or after AJAX calls
- Use CSS selectors when possible for better performance
- For dynamic content, ensure elements are fully loaded before extraction
- To get custom data attributes, use "data-attributename" format
- For multiple elements, the node returns value from the first matching element
- Consider using Wait Element before Get Value for better control over timing
- Validate that extracted values are not empty before using them in logic
Related Nodes
- Open Browser - Creates the browser session and Page ID
- Wait Element - Waits for elements before getting values
- Set Value - Sets values in input elements
- Type Text - Types text into elements
- Click Element - Clicks elements to trigger value changes