Contact Us 1-800-596-4880

Get Web Element Text

The Get Element Text action step reads the innerText of an element and returns it as the Element Text outbound variable, which makes it available for use in subsequent action steps through Pin Variables.

As an example, you can use this action step to copy an email address or other text from a web page and use it in another application.

Properties

Inbound Variables

  • Element XPath

  • Window Title

Outbound Variables

  • Element Text (string, default: blank)

    The innerText of the selected element. If the element has no innerText, this action step returns a blank string.

Wizard

To extract the text from a web element:

  1. Click Open Browser Wizard.

  2. Navigate to the site that contains the text element to extract.

  3. Position the mouse over the text element.

  4. When a blue border shows to frame the element, press F2.

    The properties of the selected element show in the side bar. In addition to the mandatory XPath, you can select other attributes that help define the correct element.

  5. Click Accept Selection (The Accept Selection icon.) at the beginning of the sidebar on the browser wizard.

Example

In this example, the Get Web Element Text action step captures an email address from a MuleSoft Accelerators documentation article:

The Browser Wizard showing a blue frame around the selected email address.

Then, in a subsequent Send Mail action step, the email address is entered as the To address through a Pin variable:

The Send Mail Wizard using a Pin variable to configure the email address.