How to donwload documents from the browser

Dear Community,

I would like to ask how to build the workflow that can download the attachment in the browser.
For instance, i would like to download the attachment from the link below : Lower Third Black Design - After Effects Project (Videohive) » free after effects templates | after effects intro template | ShareAE

I would like to download all the attachment that available in the browser result. May i know if Uipath able to detect it? It is because sometime the attachments could be 2, 3 or more inside the browser.

However, sometimes the attachment may look different layout .Is there any way that we can build the workflow in Uipath?

Many thanks in advance.

1 Like

1 : Read the browser window and add the list of all the file names to a collection.

2: Then build a selector that will accept the file path as part of the expression - either use UiPath Explorer or generate a selector using a click activity in Studio

2.1: Most likely the selector will contain the file name - this will help you build a dynamic selector unique to that file

3: Next, Loop through the list of files in the collection

  • Pass the file name to the selector expression to generate the dynamic selector

4: Pass selector to the Click Event and allow the Automation to click on file & download to the downloads folder ( if the browser has been set to do that)

  1. You have to use a Path Exists activity to check if the downloaded file exists before the Robot can loop to the next file

Once all your files are downloaded , you can then use the same collection to identify the files in the downloads folder and move them to the target location. This is lot easier than having your automation to use the File Save As feature of your Browser .



Hope these steps would help you resolve this

—use a GET TEXT activity and select the region where all the file name is mentioned in the application and get the output as a string variable named str_input

—now use a ASSIGN activity and mention like this
arr_filename = Split(str_input,System.Environment.NewLine).ToArray
Where arr_filename is a variable of type array(of String)

—then use a FOR EACH loop activity and pass the above array variable and change the type argument property as String

—inside the loop use a Assign activity and mention as str_file and value as itemToString

—then next to this assign activity use a CLICK activity and using that activity first click any of the file you want to download when clicked

—once after clicking a file name, click on EDIT SELECTOR option in that CLICK activity

—now in the edit selector window we can see the attributes and it’s values
Look for attribute aaname or text
And remove the value of that attribute by mentioning the variable str_file for that attribute
For more idea

—now for every loop the bot will click that files one by one as we are now passing the filename as a attribute value to SELECTOR

Please let know for any further clarification on this

cheers @SH_94


Dear @Palaniyappan ,

Do you have the sample workflow that i can refer to ?

Many thanks for your help.

Dear @AndyMenon ,

Thank you for the prompt response. It look like very efficient and could you share with the the samples workflow that in line with the step above?

Many thanks in advance.

Here you go with a xaml (3.0 KB)

Cheers @SH_94

1 Like