Created
November 5, 2015 23:49
-
-
Save HomerJSimpson/226eece811d729c9f3c7 to your computer and use it in GitHub Desktop.
iterating over list of links with casperjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
casper.then(function() { | |
href = this.evaluate(function() { | |
return document.querySelectorAll('a[href*="manageForms"]')[0].href; | |
}); | |
casper.thenOpen(href, function() { | |
var iFormsLinks = this.evaluate(function() { | |
return Array.prototype.slice.call(document.querySelectorAll('td:last-child a:first-child')).map(function(e) { | |
return e.href; | |
}); | |
}); | |
this.each(iFormsLinks, function(self, link) { | |
self.thenOpen(link, function() { | |
self.waitForSelector("iframe", function() { | |
screen.shot(link); | |
}); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment