如何获取网站的预览图像?
我知道甚至有一些网络资源可以让您预览网站“在特定浏览器中的外观”。
我只需要从任何浏览器查看图像。是否有可能在没有人参与的情况下获得该图像?是否可以不用系统编程,只通过纯java/python/asp.net的方式来获取呢?
UPD:http://browsershots.org/ 是所描述的网络资源的示例。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我所知道的工具可以做到这一点 - 实际上“只是”启动浏览器(当然以编程方式)并截取浏览器内容的屏幕截图并将其保存在图像中。
我认为无论你做什么,你都必须找到一种方法来做这样的事情。如果您通过系统编程引用操作系统 API 调用,那么我认为您会不走运。您也许可以获得可以为您执行此操作的第三方库,但该库将只是进行这些系统调用。
我现在看到其他人发布了可能对您也有用的地方的链接。如果不查看链接,这可能是最简单、最好的方法。
祝你好运
The tools I know of that does this - really "just" launches a browser (programatically of course) and takes a screenshot of the contents of the browser and saves this in an image.
I think no matter what you do, you will have to find a way of doing something like this. If you by system programming are refering to OS API calls, then I think you will be out of luck. You might be able to get a third party library that can do this for you, but then that library will simply be making those system calls instead.
I see now others have posted links to places that might prove themself useful to you as well. Without having looked at the links, that would probably be the easiest and best way to go.
Good luck
我相信您正在寻找的是 browsershots
I believe what you're looking for is browsershots
它有基于REST协议的API和一些文档。
It has API based on REST protocol and some documentation.
有一些网站可以让您执行此操作。
尝试 BrowserShots
There are some websites that let you do this.
Try BrowserShots
有很多事情可以为你做这件事。例如,看看 stw 。
You have a lot of things doing this for you. Take a look at stw for instance.
如果您使用 .NET,则可以使用 DrawToBitmap 方法(示例)。然而,正如您在该示例页面的最后一条评论中看到的那样,它不适用于 Flash,而且对于使用复杂 Javascript 进行渲染的网站来说,它有点“不稳定”。
我认为你最好的选择是按照其他人所说的那样使用第三方缩略图提供商。我没有使用过它,但是 http://www.thumbshots.com/ 看起来不错。
If you're using .NET, it is possible to do this using the DrawToBitmap method of the WebBrowser control (example here). However, as you'll see by the last comment on that example page, it doesn't work with Flash, and it's a bit 'temperamental' with sites that use complex Javascript for rendering.
I think your best bet is to do as others have said and use a third party thumbnail provider. I haven't used it, but http://www.thumbshots.com/ looks good.