How can I extract different registration numbers from a website?

I have list of numbers in an excel sheet and I’m using a foreach loop to read each number from the excel, go to particular website and get the corresponding registration number. I have used the click element to get it. However, it keeps throwing the below error -

Message: Could not find the UI element corresponding to this selector:

The closest matches found are:
[95%] webctrl aaname=‘01179331. opens in a new window’ name=‘false’ parentid=‘who-is-this-details-content’ tag=‘A’/
[86%] webctrl aaname=‘www.russellscanlan.comwww dot russellscanlan dot com. opens in a new window’ name=‘false’ parentid=‘who-is-this-details-content’ tag=‘A’/

I did make changes to aaname and changed it to ‘*.opens in a new window’. However, it is now printing the second closest match instead of the first.

How do I get the first closest match?

@HS_Manohar

Welcome to our UiPath community.

You should use Get Text activity to read the text from web application.

Hi,

[95%] webctrl aaname=‘01179331. opens in a new window’ name=‘false’ parentid=‘who-is-this-details-content’ tag=‘A’/

If the above 01179331 is your target number and you already have it as variable, you might be able to use dynamic selector as the following.

<webctrl aaname='{{yourVar}}. opens in a new window' name='false' parentid='who-is-this-details-content' tag='A' />

Please see the following document for how to set variable.

Or, might be able to use regex selector as the following, if some number(s) always exists before “opens in a …”.

<webctrl aaname='\d+\.\sopens in a new window' name='false' parentid='who-is-this-details-content' tag='A' matching:aaname='regex' />

Regards,

Thanks @lakshman. I’m using Get Text activity to read the text from web application.

Thank you @Yoichi.

When I went with the first approach -

I’m receiving the below error:

Message: Could not find the UI element corresponding to this selector:

The closest matches found are:
[95%] webctrl aaname=‘01179331. opens in a new window’ name=‘false’ parentid=‘who-is-this-details-content’ tag=‘A’/
[86%] webctrl aaname=‘www.russellscanlan.comwww dot russellscanlan dot com. opens in a new window’ name=‘false’ parentid=‘who-is-this-details-content’ tag=‘A’/

And with the second approach -

Source: Get Text 'A ’ (Get Text 'A ')

Message: Could not find the UI element corresponding to this selector:
webctrl aaname=’\d+.\sopens in a new window’ matching:aaname=‘regex’ name=‘false’ parentid=‘who-is-this-details-content’ tag=‘A’/

Exception Type: UiPath.Core.SelectorNotFoundException

Hi,

Thank you for sharing.

Is there any detailed information such as selector which is searched by as the following image?

img20210902-9

Regards,