Using Get Text activity to find multiple instances with similar selectors


#1

I’m practising with UiPath and decided it would be a nice exercise to make a dynamic traffic alert. The idea is that you can enter the highways you want, and it will extract info from the web and give you your personal traffic alert. It’s almost done, but there’s one issue I can’t figure out.

I’m checking whether there’s a speed camera on the selected highways through this website: http://flits.flitsservice.nl/meldingen/vandaag.aspx

I’ve got a dynamic selector to search if the highway is listed (“webctrl aaname=’”+snelweg+"’ id=‘snelwegtekst’ tag=‘DIV’ /"), then another to get the details (“webctrl parentid=‘content’ tag=‘TABLE’ /><webctrl tag=‘TD’ aaname=’”+snelweg.ToLower+"*’ /"). Here ‘snelweg’ is the variable containing the highway.

The problem is that this will only get the first speed camera that’s listed, while there may be multiple on the same highway. I can’t seem to figure out how to get a second one (and third or fourth one) in the output, so I was wondering if any of you guys have a good idea :slight_smile:

Please find the entire workflow attached below, might also be useful for any Dutchies here (I’ve got it scheduled in Orchestrator to run daily just before I leave work :slight_smile: )
Verkeersbericht.xaml (107.4 KB)


#2

@evangemert

Use Find Children activity and specify your dynamic query in the Filter attribute. This activity will return an array of matching elements.
Please refer https://activities.uipath.com/docs/find-children for more details on the activity.


#3

Thanks, seems to work after some twitching with the selectors :slight_smile:


#4

:slight_smile: