Last active
August 29, 2015 14:13
-
-
Save hitsujixgit/d90e9958f54d602147c3 to your computer and use it in GitHub Desktop.
Get captures on a list using CasperJS. (iPhone 6)
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
links = [ | |
'http://google.co.jp/' | |
'http://yahoo.co.jp/' | |
'http://bing.com/' | |
] | |
casper = require('casper').create() | |
# iPhone 6 | |
casper.userAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4') | |
casper.start().each(links, (self, link) -> | |
self.viewport(375, 667).thenOpen link, -> | |
@wait 500, -> | |
title = @getTitle() | |
@echo(title) | |
@capture("#{title}.png") | |
) | |
casper.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment