Avoid using a While loop at all possible!
One suggestion is to use Find Children activity, because then you can filter to the elements within the table by the ‘A’ tag. Then, just run it in a For each. - Since you would be looping elements, the click action is simple.
However, it’s been a long time since I’ve used that method.
Another suggestion is to extract the table using Data Scraping. This will give you a Data Table, and you can even get the urls for each item. Then, you can simply use a For each over the table for only the items with urls.
If the URL option doesn’t work, you can always use the ‘Item Number’ instead as part of the selector, and skip the ‘A’ tags that can’t be found (use Element Exists before each click, so you can check if it exists)
To use the item number, you could opt to actually use the itemRow. Many times, using UiExplorer, you can find the itemRow attribute. Then, you can use the value from the ‘Item Number’ column or the index of the ForEach as a variable in the selector:
I hope this makes sense.