Say you create a workflow that gets each item in a table, and in the table is a link or button to go to a different page with more details. You need to click each link/button to grab some data from each page.
The loop finds the first item and clicks the button, the browser goes to the details page, and you scrape data off the page. The loop goes to the next item, but now the button/link is not there anymore because you are on the details page, resulting in an error.
I assume you just found this out and are asking how to navigate back, but that will not solve it. We use selectors to find elements on a page, and all elements are then “tagged” with a unique id. This is to ensure we can find the EXACT element again (it can change when we interact with the page), so every time we need to get an element again to update it, click it, etc., we use the unique id. If you go away from the page and go back, those ids will be different or missing, so you will still get an error.
If the “list” of pages you need to go to has a URL you can grab, then grab each link, save them in an array, and then loop through the array opening each page one at a time to grab the article. If the “list” of pages you need to go to uses a button where you cannot easily get the URL, then create a different array with something unique for each button or row. Then, every time you click a button, “check off” that item you just processed so the next time you are on the page, you know you need to skip this one.
And to answer your questions, you can use the Execute Script activity with the code window.history.go(-1);