One simple but repetitive way to do it would be to wrap each click link action in a try catch block that attempts to click the link. If it's successful then it goes on to a cancel this macro action preventing clicking on further links. If it fails, the catch block will allow it to continue to the next try catch block. My example is looking at the Suggested Topics list of links at the bottom of each forum post on this site.
Test - select links but only the last one found.kmmacros (23.5 KB)
If you want to be a bit more programmatic you can loop until you get a link that works so you have less code. We count down from 6 to 3 and use the variable in the xPath to select the correct link and then cancel once we get the first one that works.
Test - select links but only the last one found loop.kmmacros (23.3 KB)