使用PHP的网页截图? [英] Web Page Screenshots with PHP?

查看:112
本文介绍了使用PHP的网页截图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道没有一个直接的方法来拍摄的网页使用PHP。什么是最直接的方法来完成这个?有没有任何命令行工具可以做到这一点,我可以从一个PHP脚本执行(我想在NIX OS(特别是OS X和/或Linux)?运行?

I know there is not a direct way to take a screen shot of a web page with PHP. What would be the most straightforward way to accomplish this? Are there any command line tools that could do this that I might be able to execute from a PHP script (I'm thinking something that would run in a 'NIX OS (OS X and/or Linux in particular)?

编辑:或者某种Web服务,我可以通过SOAP或REST或...访问

Or maybe some sort of web service I could access via SOAP or REST or ...

编辑#2:我发现了一个相关问题讨论CLI选项,

Edit #2: I found a related question discussing the CLI option, but I'd still be open to other methods if anyone knows of anything.

推荐答案

请参阅 webkit2png 用于执行此操作的OSX命令行程序。

See webkit2png for an OSX commandline program that does this.

该页面还提到Linux替代方案。

The page also mentions Linux alternatives.

[edit]: wkhtml2image 是城里最新的孩子,它比任何我使用过的更好。

[edit]: wkhtml2image is the newest kid in town, and it works better then anything else i've ever used.

[edit2]:截至2014年, PhantomJS 似乎是要走的路,因为它有最新的webkit版本的替代方案知道。

[edit2]: As of 2014, PhantomJS seems to be the way to go, as it has the newest webkit version of the alternatives I know about.

这篇关于使用PHP的网页截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆