Get Text Activity_help

I am trying to extract the phone number from the following website using UiPath:

I used the Get Text activity and my selectors are defined as follows.

Strict selector:

Web selector:

Using F2, I checked the selector visibility and it appears green on every page, so the selector seems to be valid.

I also tried adding:

WaitForReady = Complete

a 3-second delay before the activity

Additionally, I tested the element using the App/Web Recorder. When I hovered over the phone number element, the Get Text option did not appear. However, when I hovered over other elements on the page, the Get Text activity was available.

Despite all of this, the phone number output is always an empty string (β€œβ€).

Why does the phone number return null/empty even though the selector appears to match the element?

@gizem.guzeloglu

Try using Get attribute activity with the attribute which is holding the phone number value.

@gizem.guzeloglu

  1. First the selector looks dynamic as the class looks specific to page or so
  2. Open ui explorer and then indicate field you need..and in attributes if innertext shows phone number then get text will get the value

cheers

Hello @gizem.guzeloglu,

We need to troubleshoot whether the issue is with get text specific only to the phone number element or even with its parent element.

Below are two approaches I can think of:

  1. Open the UI Explorer and check the hierarchy by changing the UI frameworks. (This approach is least likely to succeed, as from your question it appears the element is identifiable and the problem is with get text, which returns an empty value without throwing an error.)

  2. Consider that the phone number will always have a specific pattern. Try using the get text activity on the immediate parent element of the phone number and apply regex to the returned string if the phone number text is also returned.

If neither approach works, try using the get OCR text activity as a last option.

Thanks,
Karthik

Hi @gizem.guzeloglu
If the selector is highlighted correctly the output should be printed check in the get text activity properties output variable is declared or not, if declared it will print the extracted phone number, if the selector is highlighted incorrect make the selector as dynamic and you can check it once again