How to render part of a page with PhantomJS?

后端 未结 5 1173
生来不讨喜
生来不讨喜 2020-11-29 00:58

I would like to render individual HTML elements into PNGs using Phantom.JS. Does anyone know if this is possible? Also, how would I use Phantom.js to render a page that the

5条回答
  •  执念已碎
    2020-11-29 01:42

    You can use the CasperJS, another project based on PhantomJS.

    casper.start('http://www.weather.com/', function() {
        this.captureSelector('weather.png', '#wx-main');
    });
    
    casper.run();
    

提交回复
热议问题