2017-01-02 72 views
1

我试图用java代码截取网页截图。我使用谷歌API来获取screenshot.But它只有有限的报价,而不是free.Can谁能帮助我获得代码使用java拍摄网页截图

+0

你可以使用phantomjs – AdamSkywalker

+0

http://stackoverflow.com/a/7583391/1475228 –

回答

0

在一个网页,你可以在HTML 5

使用html2canvas更多你可以阅读here

事情是这样的:

要使用一些选项元素上运行html2canvas只需拨打:

html2canvas(element, options); 

呈现的画布在onrendered回调事件提供,如 例如:

html2canvas(element, { 
    onrendered: function(canvas) { 
     // canvas is the final rendered <canvas> element 
    } 
}); 

欲了解更多信息,请阅读他re:https://html2canvas.hertzen.com/documentation.html

这样做Java读取这个answer