phantomhs获取网页的高度

function heheda()
{
window.setTimeout(function () {
console.log("---------------------Capture Original Begin------------------------------");
var scrollheight=page.evaluate(function () {
return document.body.scrollHeight;
});
page.viewportSize = {width:414,height:scrollheight};

page.render(outOriginalimg);
console.log("---------------------Capture Begin------------------------------");
markCapture();
console.log("scrollheight:"+scrollheight);
window.setTimeout(function () {
page.render(output);
page.close();
console.log('render ok');
phantom.exit();
}, 10000);
}, 25000);
}
);

});
}

posted @ 2017-06-29 17:13  公众号python学习开发  阅读(209)  评论(0编辑  收藏  举报