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?

the snapshot img

the 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

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -