How to click on each button when the selector ID is always the same

hello everyone,
I wanted to extract the data from the web site https://www.servicesalapersonne.gouv.fr/ , by clicking on the button each “voir la fiche détaillée” and do the extraxtion. the problem is they have the same selector, do you have any idea how i can solve this problem?

Summary

List item

@sarra.meziane
one option is to work with the feature of integrated anchoring the selector by using information from some other cells of same row. Finde some more info here:

Working with index would be alternate approach

It would be great if you can share the exact url with us, so we can do some further analysis on it and come up with some more specific suggestions. Thanks

@sarra.meziane,

Do you wanna click that button?
You could do extraction by clicking on mobile number. If selector contains mobile number in aaname and innertext,then that is done.

Plz give a try and let us know…

Cheers,
Pankaj

yes I want to click that button, the number does not exist on all lines, for innertext contains the value but aaname is empty

@sarra.meziane,

Good, you can write * in aaname and test it ad let us know…

Cheers,
Pankaj

I don’t anderstand what do you means, but index is not similar of all

here is the 1st selector, the 2nd and the 77th

It detect the line clicked

@sarra.meziane,

can you try with uiexplorer, there you may see lot of options.
open uiexplorer, click the button which u want to click, then it will list of many options in it.
there you can choose and highlight as well…

image

Cheers,
Pankaj

Yes that’s what I just did, I couldn’t detect how to click, because I can’t find a link between the lines

I have to browse the main line, after clicking on the button, because there I see idx = ‘4’ which increments, but I have a div = “divResult0” on the list I have several divResult, I tried div = “divResult *” this will not work

@sarra.meziane,

Can you plz share the link of this page? replying will not solve the problem.
need to check with app itself.

Cheers,
Pankaj

Annuaire des organismes de services à la personne | Services à la personne (servicesalapersonne.gouv.fr)

Youc choose

Hi Sarra,

what sometimes works for me in these situations is to analyze the tree structure in UiExplorer and find the parent element where all entries are listed and then use a Find Children activity on that parent element. If you can, try to filter the elements by XML filter!

Then loop with For Each UiElement and you can take this UiElement variable (item from For Each iteration) and use it for UiAutomation instead of the selector.

Unfortunately I won’t find any more time this week to assist further on this issue, but I hope this helps you with your automation scenario.

Good luck and cheers,
Lukas

thanks for your answer, unfortunately I am new to uipath I don’t really understand your method

No worries, practice makes perfect :wink:

I’ll try to clarify:

  1. Indicate “parent element” or container all your buttons are in in a Find Children activity - this could be the table column!
  2. Save Output to a variable
  3. Use For Each activity with type UiElement and your Output variable
  4. Check if the current UiElement you are using in the For Each body is actually one of your desired buttons - you could use Get Attribute activity to check for a specific keyword (Check UiExplorer)!
  5. If the current UiElement checks out use that (by default it would be the item from For Each activity) as an input for your Click activity
  6. Click all the buttons in one neat workflow - profit! :money_mouth_face:

Hope this helps!