Quite often, we need to download and store some files from websites. Reports, invoices, anything.
Quite recently, UiPath introduced a very handy activity - Wait for Download.
If you ever tried to automate downloading files, you know how tricky it can be. Browsers show some popups, then often there is a problem with the Save As popup. And you had to also check for a prompt, if that file already exists. What a work…
Thankfully, these all many activities including clicks, and types, and conditions can be now replaced with one neat activity.
The prerequisite is to set up your browser to automatically download files (to avoid the extra prompt window).
See this example:
The “Do” part is initially empty. Drag inside an activity, that will cause the download to start.
Monitored folder is your default Downloads folder. Changing the path will not change where the file will be downloaded. It only says to the robot - take a look at this folder, expect a new file here.
UPDATE: You can use
"C:\Users\"+system.Environment.UserName+"\Downloads" to use this code with any user at any machine!
Downloaded file as a datatype FileInfo is Output variable from this activity. We can use this variable to address the file, to perform next operation such as Copy or Move the file to another folder.
(we have to use downloaded_file.FullName, because activites such as Move File accept path to file as String)
After the download is done, UiPath proceeds to the next activity.
Use this activity for your automation and let me know, if this article helped you!
Do you have some issues, ideas - please ask!