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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -