我想以编程方式保存网页。
我的意思不是只保存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/