javascript - how use phantomjs screenshot the whole page -
i use phantomjs screenshot page,but can't screenshot buttom of page.
var height = page.evaluate(function() { window.document.body.scrolltop = document.body.scrollheight; } );
value of height 33943,but real value of scrollheight 44135. how can load whole page?
you can snapshot page by:
var webpage = require('webpage'); page = webpage.create(); page.open('http://www.example.com'); page.onloadfinished = function() { page.render('screenshot.png'); phantom.exit(); }
not sure why need calculate height of page.
Comments
Post a Comment