Skip to main content

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

  1. The node receives the Page ID, Selector Type, Selector, and optional Attribute
  2. It validates that the Page ID and Selector are not empty
  3. It waits for any configured delay before execution
  4. It retrieves the active page session using the provided Page ID
  5. The node waits for the element to appear on the page (up to the Wait Timeout duration)
  6. For Safari browsers, it uses JavaScript execution to get the element value
  7. For other browsers, it locates the element using the provided selector
  8. 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
  9. The extracted value is stored in the output variable
  10. 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 CodeDescription
Core.CSV.AppendCSV.ErrOnCreateConfiguration parsing error during node creation
Core.Browser.GetValue.OnMessageError parsing incoming message data
Core.Browser.GetValue.ErrPageIdPage ID is empty or not provided
Core.Browser.GetValue.ErrSelectorSelector is empty or not provided
Core.Browser.GetValue.ErrSessionInvalid or expired Page ID, session not found
Core.Browser.GetValue.InvalidFieldInvalid value for Wait Timeout field
Core.Browser.GetValue.WaitElementElement not found within the specified timeout period
Core.Browser.GetValue.ErrForwardFailed to execute script (Safari)
Core.Browser.GetValue.ErrElementsFailed to retrieve element from selection
Core.Browser.GetValue.ErrGetNameFailed to get element tag name
Core.Browser.GetValue.ErrAttributeFailed to retrieve attribute value
Core.Browser.GetValue.ErrTextFailed to retrieve element text
Core.Browser.GetValue.ErrOutputMarshalError 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