Crop screenshot to element in PhantomJS

后端 未结 1 1362
情书的邮戳
情书的邮戳 2020-12-18 15:21

I know it\'s possible to arbitrarily crop a screenshot in PhantomJS, using page.clipRect():

            page.clipRect = { 
                top:          


        
相关标签:
1条回答
  • 2020-12-18 16:21

    Anything you run inside page.evaluate is not available from the outside world, the execution is sandboxed and confined with the page context. In order to have it available, make it as a return value and then you can access it.

    Take a look at PhantomJS included pizza.js where the list of the pizzeria is returned back the caller.

    0 讨论(0)
提交回复
热议问题