在租用的 Linux 服务器上,免费在服务器端截取网站屏幕截图
好吧,现在我真的无力支付任何服务的费用。我希望能够使用租用的基于 Linux 的服务器截取屏幕截图,并将其输出到屏幕上。
我知道有很多服务可以执行此操作,但它们通常有限制或水印,或者您必须等待从队列中取出屏幕截图。
有什么办法可以自己截取屏幕截图,然后缓存它们或其他什么吗?我正在使用 PHP,但我不限于它;我只是在 Linux 服务器上,所以 GD 的相应功能无法工作。帮助! :)
Ok so, right now I can't really afford to pay for any service. I want to be able to take screenshots using my rented server, which is Linux based, and output them on the screen.
I know there are a lot of services that do this, but they usually have limits or watermarks, or you have to wait for your screenshot to be taken from the queue.
Is there any way to just take the screenshots myself and maybe later cache them or anything? I'm using PHP, but I'm not limited to it; I'm just on a Linux server so GD's appropriate functions wouldn't work. Help! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
PhantomJs 就是解决方案
PhantomJs is the solution
http://cutycapt.sourceforge.net/
没有 PHP-api,但您始终可以通过 PHP 的
exec
函数使用它。http://cutycapt.sourceforge.net/
There is no PHP-api, but you can always use it through PHP's
exec
functions.这是一个使用 phantomJS 1.5 的更好的脚本
Here is a better script using phantomJS 1.5
2017 年的解决方案之一:
https://github.com/GoogleChrome/puppeteer
示例:
One of the solutions in 2017:
https://github.com/GoogleChrome/puppeteer
example:
由于您拥有自己的Linux服务器,因此最好的方法是不受限制地运行自己的屏幕截图服务。
这是在服务器上运行它的简单解决方案:
https://github.com/filovirid/screenshot_server
它创建了一个 API,以便您可以从到处。
Since you have your own Linux server, the best way is to run your own screenshot service without limitation.
Here is an easy solution to run it on your server:
https://github.com/filovirid/screenshot_server
It creates an API so that you can access it from everywhere.