Continue until No Element Is Found
When enabled, the loop will continue running until no matching web element is found on the page. This is useful for working with lists of unknown or dynamic length, such as social feeds.
How it works
If any of the web actions (such as Save Web Element, Click Web Element, Hover Web Element, etc.) returns a selector not found error, the loop will end.
Repetition limit is recommended
If your list is long or possible truly endless (e.g. a scroll feed), the loop may run for a very long time before reaching the bottom. In these cases, we strongly recommend also setting a repetition limit to prevent long-running or stuck TaskBots.
⚠ Warning
If you enable this option and your loop does not include any web element actions (e.g., Save Web Element, Click Web Element, etc.), the loop will never end. Make sure there is at least one building block that interacts with web elements on the page.
Skipping selector not found error
If you are using the Save Web Element building block with the option Skip if no element is found enabled, or if the action is wrapped in a try-catch scope (by using the Start Try-Catch building block), your preference to skip the error will be respected, so the loop won't end when an element is missing.
In such cases, the loop will end only when the scrolling area has reached the end and no further elements can be identified after several attempts. However, if you disable the Auto-scroll option, the loop may run indefinitely — in this setup, TaskBot cannot detect the end of the scrolling area and will assume you are handling scrolling and loop exit manually.
Recommendation
Leave untoggled if you know how many elements there are on the page. It is more reliable to provide a definite number of repetitions as opposed to using dynamic auto-detection. For example, if you scrape a list of profiles and you know there are always ten profiles per page, then do not toggle this option, simply enter 10 in the number of repetitions field below.
Last updated
Was this helpful?