How to retreive the amount of search results?

I am currently building a robot around LinkedIn but they changed their userface a little bit the last few days.

My before situation:
I looked a certain person up, cheched if it says: 1 result
If so, I proceeded. If it said 2 results or more, I dropped the row I was working with in an exception box.

Now the situation on LinkedIn looks like this:

So it doesnt give away the amount of search results anymore and I am totally blank on how to solve this problem. I still need to check if there is one result before I proceed the execution.

My idea: Somehow I need to count the amount of results. If it is < 2, I will proceed. Would this be the best way?

But how to count the number of results?

Hi @ESCH, welcome to the UiPath community!! Can you try looking at the selectors of each of those names and checking if they have anything that refers to their row/index number? Maybe a tag? It will change based on the results. I had a similar problem and I just checked for the row numbers, which were present in each selector. If there are, say, a maximum of five rows, you could make the selector dynamic and use element exists within a loop with that particular selector. Hope this helps!

1 Like

Thank you! :slight_smile:

I looked for a row or index number but I couldn’t find any. I also looked in the visual tree on the left. Any other ideas?

Hi @ESCH, in the screenshot you shared, there’s a tag called “idx”. That’s going to change based on the result. It will be “1” for the first result, “2” for the second, and so on. You could replace it with a variable to make it dynamic, and then use a loop.
EDIT: It doesn’t have to start with “1”. But it will change based on the result.

1 Like

That would make sense, but apparentely it does not work that way here.

I made this example on the different ways you can place the selecton on one of the results. When I choose to make the biggest selection for example, all search results have idx = 2. When I select a smaller piece of the result (only the name for example) idx = 1 on all of the search results.

If possible, can you send me that Linkedln page? Maybe I can take a look at it!

1 Like


Hi, so as you can see, in the page that I opened, it does show the number of search results! I wonder why it’s not visible in the screenshot you posted. I also tried selecting different results, and I can’t find a value that gets incremented in the selector.

I know, this was what it looked like four days ago here as well. LinkedIn is rolling out their new interface and I don’t see these number of results anymore. :cry:

I see! I’m not sure how to get around that, to be honest! Wish I could’ve helped more!