Download from variable list of files

I need to download from a list of links from a website that vary on a daily basis. For example, today I can see the following


I need to click on each of the download links to download each of the files and save them


How can I loop through all the links?

can u share website link

It is a restricted website (

If it helps, the selector for the download button is as follows:

If I select the 2nd, the selector is as follows:

<html title='Copilote' />
<webctrl idx='2' parentid='content' tag='A' />

I guess I need a way to find out how many index links there are and then loop through them (somehow)

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.

@andrzej.kniola: thanks the the guidance.

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.

webSite.html (1.1 KB)
testting.xaml (13.6 KB)

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.

Let us know how it goes.

1 Like

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.

testting.xaml (12.8 KB)

Try with this one:
testting (1).xaml (14.3 KB)

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’

Thanks again!!

I tried your solution, but i can not write a line with .selector.toString. There is only “.select” expression, could you plz help me?

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?

Can you post a screenshot or your xaml?
Are you sure your element is of type UiElement?

Ohhhh, thankU,!! As you said, my element is not a type of UiElement!! Now I solved my problems!