Skip to content

Instantly share code, notes, and snippets.

@hitsujixgit
Last active August 29, 2015 14:13
Show Gist options
  • Save hitsujixgit/d90e9958f54d602147c3 to your computer and use it in GitHub Desktop.
Save hitsujixgit/d90e9958f54d602147c3 to your computer and use it in GitHub Desktop.
Get captures on a list using CasperJS. (iPhone 6)
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