Clicking a dynamic amount of links


I have a process where I need to go to the OFAC website and check aircraft serial numbers. The part of the process I am stuck at is building the automation to click on the links if a positive result is found. Sometimes there could be 1 result and sometimes there could be multiple. I need to know how to click each link that appears and then copy the aircraft model on the next page and then click the back button. If there is another link, the process needs to repeat. If not, it will search the next serial number. I have attached my current build. To test, please use serial number “27623”. This will produce 2 results.

Thank you!
Playground.xaml (23.0 KB)

Something like this: (27,7 Ko)

You’ll need to read the search results into a datatable. Then you can use the name to create a dynamic selector that will click on the correct link.


Thank you! How to set a dynamic selector is what I was missing and couldn’t figure out. Really appreciate the help.

Hi Anthony,

I’ve updated my selector to match yours exactly but mine will not validate. Any idea as to why?

It may not validate if the variable value cannot be interpreted while the script isn’t running. However, it will likely be valid once the code is run.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.