You could try using FindChildren activity from the container (use the content element for it) with filter like <webctrl tag='A' />.
It will give you an Enumerable<UiElement> that you can ForEach through.
I donāt seem to be able to find the children though.
See the XAML file attached. Iāve added a text box to show me how many items are found, but if finds none
Also, Iām attaching the html code that I think it is relevant to the download items in the website it helps to define properly the Find Children activity.
Thanks for the attachments, it helps to see the structure.
There seems to be a little misunderstanding on how to use FindChildren. Selector property should point to the container, or in other words first common ancestor. Filter property should describe what children/descendants you want to find.
In your attached workflow Selector is pointing to a link (or a) element already, and that has no children.
Set your Selector property to something like this (Iām guessing how it looks - check with UiExplorer) <html title='Copilote' /> <webctrl aaname='content' tag='DIV' />
Set the Filter property to: <webctrl tag='A' />
You could also check with Scope being FIND_DESCENDANTS instead of FIND_CHILDREN, depending on if itās directly under your container or further down.
Try also searching for other topics with FindChildren, there were some examples somewhere on the forums.
Inside the ForEach donāt use selector in the Click activity - pass the item into Element property instead, so that it will use previously found element directly.
Thanks @andrzej.kniola. I managed to do some progress with your advice.
I have found the children with "<webctrl />", but it founds 7 rather than 6 (there are 6 download links) With <webctrl tag='A' /> doesnāt find anything. Iāve tried to select different parts of the web site, but it didnāt make any difference. What Iām selecting now is the part of the screen where the download links are located.
Maybe web scrapping the page and counting how many āDownloadā links I could find might help instead?
Selecting item into Element property gives me an error message.
I managed to make it work with a do while loop instead. The problem I have is that as it finds 7 elements it gives me an error at the end when trying to find and element that can not find.
Iāve added a childrenFoundArray = ChildrenFound.ToArray to be able to access via index and changed clicks and highlight to use prefound elements.
In the ForEach changed TypeArgument to UiPath.Core.UiElement - it was left as default (Object).
Also added a WriteLine with .Selector.ToString and innertext attribute in the loop and changed the condition a little (you can compare counts directly and string comparison would break if above 10 as with strings "2" < "10" = False). If all of them will return āDownloadā and the weird one will return something else, you could filter it out or omit in an If.
Itās interesting that it doesnāt find anything with tag āAā, as judging by the selectors themselves it should, or Iām missing something.
Pertect!! Thanks @andrzej.kniola. This works very well. And thanks also for the .Selector.ToString tip. The process gets the headings, but like this I can exclude it and just pick up on the ones containing āDownloadā
I have the same issue with you but i can not write a line with .selector.toString. There is only ā.selectā expression. could you please tell me what should i do?