抓取“预览”网页的Python

发布于 2024-08-23 08:29:40 字数 348 浏览 5 评论 0原文

我正在为链接列表建立索引,这些链接经常更新,因此我正在自动生成网站的缩略图。

对于大多数网站来说,这很容易,因为我只是抓取页面上最大的图像,希望它能描述内容。

但其他时候有视频作为页面的主要内容。


有人有处理这个问题的建议吗?那太好了!


关于使用Webkit创建屏幕截图我找到了这个

I'm indexing a list of links, these links update quite often so I'm automating thumbnails for the sites.

For most sites it's easy, as I just grab the biggest image on the page hoping it describes the content.

But other times there are videos as main content of the page.


Does somebody have tips with dealing with this? That would be great!


Regarding the usage of Webkit to create screenshots I found this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陈年往事 2024-08-30 08:29:40

wkhtmltopdf 使用 WebKit 渲染引擎的嵌入式副本(在 Safari、Chrome 等中使用)将网页保存为 PDF,包括所有图像(不过我猜没有 Flash 视频)。这可能是更准确的缩略图的起点。

wkhtmltopdf uses an embedded copy of the WebKit render engine (used in Safari, Chrome etc.) to save a webpage to PDF, including all images (no Flash video though I guess). That could be a starting point for a much more accurate thumbnail.

樱&纷飞 2024-08-30 08:29:40

有一些服务(免费和付费)可以满足您的需求。我使用缩小网络

There exists (free and paid) services that do exactly what you need. I use shrink the web:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文