How to download attachment from website in a loop?

This website that I am using is to collate survey responses that are stored on the website. I am trying to download attachments from the website.

In this screenshot from the website, consist of a HTML table.
When I click on one of the HTML column table, it will direct me to a new page.

In this page, I want to click on the Download 2 Attachment(s) in ZIP where it will appear the save window. I also want the zip file to be save by the person’s name taken from the 1st question
What is your name?.

I want the robot to loop and save every attachment of every response by clicking the blue left button. But the response may is dynamic. It might be more than 4 responses. So how do I loop this activity?

Thank You

If you always filter by “All dates” and you get the number of “response(s)” like in this case its 4.

You could maybe try to extract(Get Text activity) the “number” element in this case it was 4.
Assign the number to a variable and create a while loop.

Now you have a counter(you need to create it, "Counter = Counter + 1) and your variable.

Counter < number

The rest of your activity …

Extract html table as structured data table.
For each row in data table, use click activity and click specific item.
You can get item info from your row.
It will redirect to your download page.
Download the attachments
Click back to list

This will loop until it clicks all items

Hi, I have tried to use a while loop for this method.
It runs to download attachment of every row.
But it won’t stop running after the last row. It will keep repeating in the last row. How to make it stop after doing the last row?
Also when I check the download folder, there’s no zip file being downloaded.

whileloop

whileloop2

Thanks.

I have tried your method.
I use Data Scraping to extract the structured HTML data table.
Use for each row activity, in do, I use click activity to click on the first row of that data table to direct me to the download page and click on download attachment and click back to list.
But when I tried running it,
it will loop and select only the first row.
It did not loop until it clicks the next row till it ends.

ForEachRow

ForEachRow2

Thanks.

Hi @SITI_NUR_ALYSHYIA

When u are navigation to each page can u check whether the url contains some similarlity ?

Hi

Put this:
image
last in you While activity.
image

The “Get Text” acitivity should output the variable “number”(contains the 4 or whatever number currently displayed).

1 Like

Hi @NIVED_NAMBIAR

The URL stay the same for each page.

Hi @atomic

Thank you. It works now.

Hi @sravani22

I have edited to make this for each row method works. I have put the click specific item outside of for each row and use blue right button instead of back to list. Thanks.

if it works, can you mark it as solution pls

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.