简体   繁体   English

在Google App Engine中以编程方式拍摄网址的屏幕截图吗?

[英]Take a screenshot of a URL programmatically in Google App Engine?

I would like to take a screenshot of a rendered webpage in Google App Engine. 我想在Google App Engine中截取渲染网页的屏幕截图。 Any suggestions on the best way I can accomplish this? 关于实现此目标的最佳方法有什么建议吗? Any Java libraries that I can programmatically render a page to a JPG or PNG? 我可以以编程方式将页面呈现为JPG或PNG的Java库吗?

You would really need a complete render engine for this to work, and I doubt any of them would run on Google App Engine. 您确实需要一个完整的渲染引擎来使其正常工作,我怀疑其中任何一个都可以在Google App Engine上运行。 I think it would be best to use an external API such as thumbalizr . 我认为最好使用诸如thumbalizr的外部API。 Also have a look at BrowserShots . 还可以看看BrowserShots

i would use a public webservice for that. 我会为此使用公共网络服务。 something like girafa . 类似吉拉法 if you need shots for all browsers browsershots is the one for you. 如果您需要所有浏览器的快照,那么browsershots就适合您。

This answer is a bit late but might be helpful for anyone who is still looking for an answer as it comes first in Google search results. 这个答案有点晚了,但是对于那些仍在寻找答案的人可能会有所帮助,因为它首先出现在Google搜索结果中。

With Google App Engine support for Node.js, it is possible to take screenshots using headless chrome with puppeteer. 借助Google App Engine对Node.js的支持,可以使用带有伪造者的无头chrome截屏。

The Google team has put down the guide on the link below: https://cloud.google.com/appengine/docs/standard/nodejs/using-headless-chrome-with-puppeteer Google小组已将指南放到以下链接上: https : //cloud.google.com/appengine/docs/standard/nodejs/using-headless-chrome-with-puppeteer

Try whether you can use SWT in GAE. 尝试是否可以在GAE中使用SWT It contains a browser control which you can render to. 它包含一个可以呈现的浏览器控件。 I've posted an answer here with some code how to do save the content of the browser widget as a PNG but I can't find it anymore. 我在这里用一些代码发布了答案,该代码如何将浏览器窗口小部件的内容保存为PNG,但现在找不到了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM