【问题标题】:Set PhantomJS to capture entire screen after using clipRect()使用 clipRect() 设置 PhantomJS 以捕获整个屏幕
【发布时间】:2013-01-01 00:54:07
【问题描述】:

在设置page.clipRect 后跟page.render 之后,如何禁用clipRect 以便后续页面呈现整个视口?

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!

【问题讨论】:

    标签: javascript jquery screen-scraping phantomjs


    【解决方案1】:

    只需重置 clipRect 的所有值:

    page.clipRect = { left:0, top:0, width:0, height:0 }
    

    然后 PhantomJS 将再次重新捕获整个内容。

    【讨论】:

    • 软件的创建者自己回答问题是不是很酷?我觉得很酷。
    猜你喜欢
    • 2017-03-15
    • 2012-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多