There are a couple of ways to set up a loop. The first way is the easiest if it is viable, and involves looping over tags which all share a class attribute.
To determine whether looping through tags with the same class
might be possible, find the elements in the HTML view. In the case shown
above, it would be possible to loop through the three div tags with the
The easiest way to create the loop, is to right click the first tag and select to Loop For Tags With Class as shown below.
This creates a For Each Tag Path step in the robot, which loops through all elements on the page with the given class. Use the arrows on the loop step to ensure that the correct tags are included in the loop. There might be other tags on the page that you don't wish to include in the loop but which use the given class. These can often be excluded from the loop with an easy fix. Click on the For Each Tag Path step and take a look at the HTML view. As shown below the For Each Tag Path has automatically included the entire page as the found tag.
However, by changing the found tag, it is possible to force the robot to only loop through tags within another given tag.
Once the loop has been successfully created, any steps added after the For Each Tag Path step will be repeated for each iteration of the loop.
In the example above showing the robot view, the robot will
extract two pieces of text, a
title and a
preview, and return those values, for each iteration of the