Download files from web with multiple page

Hello.
I want to get data from webpage.
But sometimes there are a lot of data, it make multiple pages like below
image
Usually only 1 page is enough, but sometimes there is more than 1 page.
How can I repeat this process for unknown multiple pages?

Hi @111153

Here is the steps to handle your scenario.

step 1: Use ‘Element Exist’ activity to identify whether multiple page UI Element is present in the page.

step 2: If present, Use ‘Get Text’ activity to get the whole text from the pagination UI element in the web page. Ex: PaginationText= 12. If not, the current steps your are following.
image

step 3: Get the last index of the PaginationText variable to get the last page number. Ex:2

step 4: Use ‘Do While’ loop and based on the page number condition with the loop index. Ex:PageNumber<=LoopIndex.

Inside the loop, create dynamic selector based on the page number and perform a click on the available pages one by one

In the screenshot highlighted 1 indicating page number, so it should be dynamic as below

step 5: Place your code to download inside the loop.

Hope this will be helpful. Thank you.

1 Like

I would add that it’s possible to use REFramework to navigate such scenarios, creating a bot that’s more resistant to failures.
I believe the current Advanced module in UiPath Academic has the example of a dispatcher that navigates pages using REFramework.

1 Like

Hi @Lucas_Ferraz

You can create dispatcher project in the case, the data you are downloading from the webpage will be the input for the main process/BOT you are developing.

Anticipating download data will be treated as transaction for the main process.

Thank you.