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!
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 torownumber
- 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
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
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
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
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.
The tool will identify this object as part of a Table (Table Cell), this time click âNOâ
It will ask for the second element to complete the pattern. (Click the next download link)
Check the âExtract URLâ and click next.
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.
This is just a quick demo, Goodluck and Happy Automating
Regards,
Ken
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
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.
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.
row(âURLâ).toString: index 1 value is equal to this URL.
and so on⌠.
Thanks,
Ken
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
@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.