是否有可能“抓住”? PHP 中的网页图像?
我的意思是获取渲染的 HTML 并用它制作 Jpeg/GIF。这个想法是制作页面的数字快照。
What I mean is to get the rendered HTML and make a Jpeg/GIF out of it. The idea is to make a digital snapshot of a page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能需要比其价值更多的努力。为什么不看看已经为您提供此服务的服务呢? (像亚历克斯)
It will probably require far more effort than it is worth. Why not look at services that already provide this for you? (Like Alexa)
你不能只用 PHP 来做到这一点;但是,从 PHP 中,您可以启动一个浏览器,指示它必须加载您想要的 URL,然后从该浏览器获取“屏幕截图”。
我曾多次听说 Firefox 能够做到这一点——这里应该有几个问题+答案,可以帮助您入门;这里有几个:
You cannot do that in PHP only ; but, from PHP, you can start a browser, indicating it that it has to load the URL you want, and, then, get a "screenshot" from that browser.
I've heard a couple of time of Firefox being able to do that -- should be a couple of questions+answers here on SO that should help you get started ; here are a couple of those :
HTML 到 PDF 怎么样?许多库可用。 PDF 可以反过来转换为图像吗?
那可以做吗?还是我离得远了?
How about HTML to a PDF? Many libraries available. And PDF's can in turn converted to Image?
That can be done right? Or am I way off?