LoginSignup
3
3

More than 5 years have passed since last update.

PhantomJS で数秒待ってからスクリーンショットを保存する

Posted at

PhantomJS で Web ページのスクリーンショットを保存する - Qiita

こちらでスクリーンショットの保存方法を簡単に書いた
今回はアニメーションが含まれたサイトのスクリーンショットを保存する方法を紹介する

index.coffee
page = require('webpage').create()

page.open 'http://www.tamurayukari.com/information/2016/02/674.html', (status) ->
  if status = 'success'
    window.setTimeout ->
      page.render 'yukari.png'
      phantom.exit()
    , 1000
  return

window.setTimeout を使って待つことで対処した

3
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3