Click on all links matching a selector
I have a list of links that I have to simulate a click on using CasperJS. They all share the same class. However using this.click('.click-me') only clicks on the first link. What's the proper way of clicking on all the links? I'm thinking that maybe I should try to get the number of links via evaluate() and then use a for loop. But if I use evaluate() with the number of links I have to use messages to communicate back and that seems complicated. Is there a better way? Tyson Nero I ended up using the nth-child() selector to accomplish this. Here's how... Page: <ul id="links"> <li><a href="#1">1