问题描述:

I'm looking to capture a 5000px long screenshot. But after capturing, it only captures content that is equal to the height of my desktop screen height which is 1080px and rest is blank.

casper.viewport(1024, 5000);

网友答案:

Make sure you set up your Casper options correctly. Look at their documentation at http://docs.casperjs.org/en/latest/modules/casper.html#index-1.

It appears there is a secion on viewport size here http://docs.casperjs.org/en/latest/modules/casper.html#viewportsize. From the docs: PhantomJS ships with a default viewport of 400x300, and CasperJS won’t override it by default.

相关阅读:
Top