How can i download multiple files from website ? and if it navigates to another page then how can it be done?

I have to download multiple files from webpages and once it done with current page it should navigate to another webpage and the process should continue till it reaches the end of the page, any help would be appreciated please!


1 Like

Hey @kaavya

That’s a pretty cool scenario.

  • Scrape the total number of pages from the bottom of the list (30 in your case)
  • Add a loop which runs n times (dynamically calculate and find the count to run the loop n number of times [ Total pages / Items per page ] 30 / 10 = 2 | n = 2 in your case)
  • Now identify the download button selector and add either idx or any other attributes which points to rownumber
  • Click the download button on every iteration and populate the attribute or idx with a dynamic counter (1-10)

That’s it, we are done.

This will make the automation run for all the pages dynamically.

Hope this helps.

Thanks
#nK

1 Like

please can you let me know in detail like how it can be done? @Nithinkrishna

actually I have used data scraping to scrape till 30th page and put it in a data table and used for each loop row and passed that data table into it and in the idx part I have given variable and declared variable value as 1 because i checked with selector and it is starting with 1 but i don know why am i getting this error


@Nithinkrishna

thanks,
kaavya

1 Like

Okay @kaavya

That’s great. Even this approach helps.

But one small thing in the extract data have you also extracted the hyperlink of download button.

Thanks
#nK

yeah i did so and now i could download files but the problem is, it is not navigating to another page in order to carry further process and one more important thing is, there is no fixed number of pages like today i will have 30 pages and tmr it might be adding more pages to it, so how could achieve this ? @Nithinkrishna

1 Like

The extracted data table divided by 10 will give you the no of pages

@kaavya - Can you please use the data scraping, which you able to extract the entire data table along with URL and output value is DT. Now you can call the value of URL inside For Each activity, that would be easy to download one by one file. i hope this would be helpful.

Happy Learning :slightly_smiling_face:

1 Like

i tired that too but url column is blank @saijagadesh06

Hello @kaavya ,

Like @saijagadesh06 I will also do the same.

Click on Data Scraping, on the first value please click the link you want to download.
image

The tool will identify this object as part of a Table (Table Cell), this time click “NO
image

It will ask for the second element to complete the pattern. (Click the next download link)
image

Check the “Extract URL” and click next.
image

It will display an Extract Wizard for you to see the designated output, click Finish.

It will ask if you want to scrape data with multiple pages. (Click YES) and indicate the Next button for navigating the next page.
image

This is just a quick demo, Goodluck and Happy Automating :slight_smile:

Regards,
Ken

2 Likes

thank you for such a deep demo! but i have already tried but URL wasn’t working in my case please check my attachment below.

but i tried the same data extraction method without URL and using index variable as ‘idx value’ in selector and but only thing i haven’t achieved is i couldn’t navigate to another page because in the first page it has 10 files to download when it navigates to next the index value will be 11 at that point but it should start again with index 1 - 10

1 Like

Hi @kaavya,

I will not recommend using the index variable on this example of scraping as you already have the Data Scraping wizard that will extract your data and store it to the ExtractDataTable variable.

The demo above was to extract the download links but not to process the rows from the ExtractDataTable. To achieve this you need to use For Each Row Activity in this way, you don’t have to worry about how many rows or indexes are there. Simple Open Browser, Navigate To, and calling the row from Data Table will do.

Please see the image below.

Where URL comes from the Extract Wizard.
image

Open Browser Activity for setting up where the download will occur.

I used Navigate To activity to open all URL Links to the same Browser address and add 5 seconds of delay for each file to download.

My final output looks like this.
row(“URL”).toString: index 0 value is equal to this URL.
image

row(“URL”).toString: index 1 value is equal to this URL.
image

and so on… .

Thanks,
Ken

1 Like

thank you so much @Kenneth_Balana, i will try and if anything goes wrong will get back to you

Yep, I also notice that you used click activity. I just replaced it with navigate to. Let me know once you’re done :slight_smile:

1 Like

@Kenneth_Balana above method was not working as i said earlier when i extracted, it doesnt provide me url, so what i did like used actions column under which download options come and tried your way but getting nthg and its not even navigating to another page see this is how i got it


and though my url column doesnt contain aything but still wanted to try so this is what error i received

thanks,
kaavya.

2 Likes

You need to allow or add the UiPath Extension for you to be able to make a process using the browser.
image
image

You should have an icon of Uipath on the browser.
image

To do this Open Uipath Studio, select Tools
Find the UiPath Extensions and select Chrome.

Close your chrome then click OK.
image