Why are you using data scraping with For each loop.
Is it structured data ? If yes, then use Data scraping activity and indicate next page navigator to retrieve data from all pages. And the final result will be stored in dataTable.
Yes, we have to use data scraping here to scrape data from different pages as it is structured data. And also click on next button to indicate page numbers like 1,2,3 etc…
It will scrape data from all web pages and will store result in dataTable.
The webpage structure differs a little bit with reference to the html page. Compare the ExtractMetaData parameter of the Extract Data activity, while using data scrape for each of these pages.
Might have to generalize this for all the pages that you need to extract data from.
I will try sharing for the two pages that you have mentioned above.
I observed the table patterns on both the pages. They seem slightly different. In this case the same meta data would not suffice for extraction from both the tables. not sure about the other pages.
Page 1 - One <ul> element has all the list items within it, under Featured Company Listings.
Here the pattern is straight forward for data extraction
Page 2 - There are two <ul> elements here. The first one holds only one result, and the second one holds rest of them. This does not show any difference on the UI displayed though. But this is what affects the extraction pattern for data scraping.
So how to go around solving this issue -
My best suggestion would be to talk to the developers if you know them and check if this is an unexpected behavior, as two result containers are displayed. If it is abnormal and if they can fix it like page 1, problem solved - same meta data is enough to extract from both the pages and your existing code would work.
The only other way around that I can think of is to observe all the patterns for the pages and separate out the ones which are abnormal like page 2 - have an specific data extraction methods for the abnormal pages. For the normal pages with the pattern like page1, you can loop them through.
In a same webpage, i have a dynamic value, everytime it changes, I’ll have a new DataTable. I need to scrape it each time but, with the data scraping, I’m getting Attach browser/window also.
Everytime that dynamic value changes, the Data Scraping output is same as the data
I’ve used to scrape.