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 cl
this.click(\'.click-me\')
I ended up using the nth-child() selector to accomplish this. Here's how...
Page:
1 2 3
Script:
casper.then(function() { var i = 1; this.repeat(3, function() { this.click('#links li:nth-child(' + i + ') a'); i++; }); });
You obviously don't have to use repeat but any iteration technique should work.