在设置了page.clipRect
后跟page.render
之后,如何禁用clipRect
,以便后续页面呈现整个视口(viewport)?
page.clipRect = {top:0, left:0, height: 10, width: 10} ;
page.render('screencap.png'); // cropped image
page.clipRect = '';
page.render('fullscreen.png'); // still cropped image!
最佳答案
简单地重置clipRect
的所有值:
page.clipRect = { left:0, top:0, width:0, height:0 }
然后 PhantomJS 将重新捕获整个内容。
关于javascript - 使用 clipRect() 后设置 PhantomJS 捕获整个屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14107138/