Nesting While statements for Webpage scraping

I understand that only more recently was UI.Vision able to support the nesting of While statements etc. I cannot find a working demo/example to show how this should be coded.

Could some kind person perhaps put a simple example together from a starting page.

This link https://www.rapidonline.com/Catalogue/Search?Query=red produces a list of ‘red’ products.
There are 20 products on each results page.

How do we step through each of those 20 products, go to the product page and say extract, say, the “Brand” field?

How do we then select the results page selector for the next page of 20 products, say up to the first 5 pages? That would be 100 products in total.

Many thanks.

only more recently was UI.Vision able to support the nesting of While statements etc

Yes and no. Nesting support was added a few years ago. What you maybe saw posted in the forum recently were some were specific bug fixes for edge cases.

Anyway, just to clarify: So the goal is to extract the product name and the brand for the first 100 products in this “red products” list, right?

Yes , that was just an example. The generic task which can be applied to many websites that invoves a search. So the process is:

  1. Step through the results list, accessing each sub-page (e.g. product page)
  2. Extract some specific fields and save to CSV
  3. When the page is complete move to the next page (e.g. ether numbered, ‘>’, ‘next page’)
  4. Repeat, working through the next page from step 1.

I think it needs two ‘While_v2 … End’ loops nested to achieve this. The link https://www.rapidonline.com/Catalogue/Search?Query=red is an example of a starting page.

Thanks.

Is anyone able to provide a working example of how to achive the nesting of while loops using the example site I have quoted red | Rapid Online

Thanks.