caching - 如何以编程方式保存网页?

标签 caching web-applications screen-scraping html-content-extraction

我想以编程方式保存网页。

我的意思不是只保存HTML。我还想自动存储所有关联的文件(图像,CSS文件,也许是嵌入式SWF等),并希望重写用于本地浏览的链接。

预期用途是个人书签应用程序,其中的链接内容会被缓存,以防原始副本被删除。

最佳答案

看一看wget,特别是-p标志

−p  −−page−requisites
This option causes Wget to download all the files
that are necessary to properly display
a givenHTML  page. Thisincludes such
things as inlined images, sounds, and
referenced stylesheets.

以下命令:
wget -p http://<site>/1.html

将下载page.html及其所需的所有文件。

关于caching - 如何以编程方式保存网页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1732318/

相关文章:

asp.net - 在 IIS/ASP.Net 的 .NET 1.1 应用程序中创建 .NET 3.0 子应用程序

javascript - 从天气网站抓取完整的 html 数据

javascript - 通过在 php 中即时生成的浏览器缓存 JS 文件

java - 查询级别 2 缓存抛出 ClassCastException

web-applications - 如何将 Web 应用程序部署到桌面?

Eclipse:更改 Maven pom.xml 文件中的 webapp 文件夹

mongodb - Meteor 如何处理多个用户的同一订阅?

ios - IOS应用应该使用什么Cache方式

python-requests - 使用 dask 通过请求进行抓取

html - 按类和标签名称的网页抓取元素