Get Text activity is returning different data from the website

Hi guys!

I’m trying to get the registration company number of a firm from a website. However, the Get Text activity is returning different elements from the webpage.
For ex:

  1. I go to NewRegister > Enter 311584 in the “Enter a Name or Reference Number text field” > Choose Firm as the option and Enter > Click on the first firm that shows up > Capture the Registered Company Number
    In this case, I correctly get the Registered Company Number.

  2. I go to NewRegister > Enter 311584 in the “Enter a Name or Reference Number text field” > Choose Firm as the option and Enter > Click on the first firm that shows up > Capture the Registered Company Number
    In this case, I correctly get the Registered Company Number.

  3. I go to NewRegister > Enter 312026 in the “Enter a Name or Reference Number text field” > Choose Firm as the option and Enter > Click on the first firm that shows up > Capture the Registered Company Number
    In this case, I am getting www.ibsbroking.com which is below the website element.

I’m using the below selector -
image

I have tried a lot of different selectors but it is not working.

How do I get the the correct Registered Company Number in both the cases?

Thanks,
Manohar

Try below selector

I created this selector for IE on this page

image

Hi @HS_Manohar

Try to use css-selector attriibute in UI Explorer

Regards,
Nived N
Happy Automation

Hi @ghazanfar,

Thank you for taking your time to answer my question. I tried using the above I got an error and it didn’t work. However, there are a couple of things that I want to highlight -

  1. We are trying to get the Registered company number and not the firm reference number.
  2. I have an excel sheet with more than 500 reference numbers. So it has to be dynamic.

Thanks,
Manohar

Hi @NIVED_NAMBIAR ,

I tried using css-selector attribute in UI Explorer. However, it is still fetching different elements.

Thanks,
Manohar

never use css in the selector it changes every time… Let me check again

@HS_Manohar Which part is dynamic I mean we are first entering register number.
Enter 312026 in the “Enter a Name or Reference Number text field” > Choose Firm as the option and Enter > Click on the first firm that shows up > Capture the Registered Company Number

which part is dynamic?

Hi @HS_Manohar

Try this selector

<html app='chrome.exe' htmlwindowname='_self' title='*' />
<webctrl css-selector='a[class=&quot;text-link text-bold text-link_default text-color_weak hide-href-print cShPo_LEX_Reg_Hyperlink&quot;]' />

After getting the text u had to use replace method to replace a particular string to get the number

See the workflow for more information

Check this workflow
Main.xaml (10.6 KB)

See whether it works fine for u

if yes, mark the answer as solution

Regards,
Nived N
Happy Automation

Hi @NIVED_NAMBIAR,

I’m using Internet Explorer to carry out this activity. I did copy paste the above selector but the validate button is throwing an error i.e. its red.

Kind regards,
Manohar HS

Hi @HS_Manohar

Please see the below workflow and let me know if it works for you.

TRegistered company.xaml (5.2 KB)
ested on IE

Hi @ghazanfa

The initial entering different reference numbers… that is I have given only 2 reference numbers as an example but I have more than 500.

you can make it dynamic as per your requirements. But it will highlight the correct Registered Company Number.

Hi @ghazanfar

I don’t see any element selected in Get Text activity -
image

Hi @NIVED_NAMBIAR

I can’t see anything in the Get Text activity

image

Thanks,
Manohar

Just indicate a registered company number element and then keep the top node (root node)

And paste the <webctrl css-selector…

part below

Regards

Nived N :robot:

Well u can not see it

Did u run in chrome and see the result ?

Hi @NIVED_NAMBIAR

I can’t run this in Chrome since I can’t install Chrome.exe extension for UiPath in my company laptop. I have to use only Internet Explorer.

Thanks,
Manohar

Can u paste the complete selector u got by indicating from internet explorer?

open below page

Run my code and in the output pane write line output will show it will show registered company number

Here you go -

I have added your code to it as well.