Scrape data from multiple website pages by adding 1 on URL and append data in one spreadsheet

The website I am trying to scrape is Securities Class Action Clearinghouse: Filings Database. It has pages up to 209. I am trying to copy and paste the list on each of those pages into one excel spreadsheet. I can see that it opens up the correct webpage with the ‘while’ I have, but when the procedure copies and pastes data into the spreadsheet, I have data from page 2 repeated over and over. In other words, I expected data from page 1, 2, 3, 4, but the spreadsheet repeats page 2, 2, 2, 2.

I am suspecting I need to create different ‘ExtractTable’ for every page. Is that what’s missing here? How would you do that?

Main_dowhile.xaml (12.2 KB)

1 Like

You need to use Append Range instead of Write Range. Write Range will overwrite the sheet so you will end up with just the data table extracted from the last page.

Alternative 2 is to create a second datatable variable and append the extracted datatable to it using the Merge Data Table activity. Then outside the while loop, you can use Write Range to save the merged data table to an Excel file.

Hi @data_guru and Welcome to the Uipath forum
The issue here is that you are scraping the same table, same page over and over.
You need to integrate the page number parameter to your selector in order to scrape the correct table/page.
Take a look at this and let me know if it works :slight_smile:
Data Scrape.zip (36.1 KB)

You are a life saver. Thank you so much!

1 Like

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