Use case #
The Loop command in RTILA is used to repeat all the actions within the loop a specified number of times. This is especially useful in web automation and scraping projects where the same sequence of actions needs to be executed multiple times.
Imagine you have a list of URLs that you need to scrape or automate actions on. These URLs are stored in a List variable, and for each one, you need to perform a set of tasks—such as navigating to the URL, extracting data, and closing the page. In this scenario, the Loop command is essential. It allows you to automate the following steps for each URL:
- Go to URL: Open the webpage from the list.
- Extract Data: Scrape the necessary information from the page.
- Close Page: Close the page and proceed to the next URL.
The Loop command is crucial for situations where you need to repeat a sequence of actions efficiently. It streamlines the process and saves you time, especially when working with repetitive tasks across multiple pages or data points.
For …. to loop: This loop has numerical conditions where you can configure where to start, where to stop, and by how much you want to increment.
How to add & configure the Loop For … To #
Add the command #
You can add the loop command by navigation to add commands button the search for loop
Configure ( for … to loop ) command #
The Infinite Loop command requires no additional configuration and runs indefinitely until manually stopped or a break condition is triggered. On the other hand, the For…To Loop command offers more control and flexibility by allowing you to configure the following parameters:
- Start Value: Define the initial point where the loop begins.
- End Value: Specify the condition that ends the loop once the target value is reached.
- Increment Value: Set the amount by which the loop counter increases after each iteration, giving you fine control over how the loop progresses.
This allows for precise customization of how many iterations the loop runs and how the counter behaves at each step.
For … To loop in action #
For … to loop command template #
https://rtila.com/files-download/For-to-loop-caommand-template-demo.rtila