在 linux 服务器上保存完整网页的最佳方法是什么? [英] What's the best way to save a complete webpage on a linux server?

查看:48
本文介绍了在 linux 服务器上保存完整网页的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的 linux 服务器上存档完整的页面,包括任何链接的图像等.寻找最佳解决方案.有没有办法保存所有资产,然后重新链接它们以在同一个目录中工作?

I need to archive complete pages including any linked images etc. on my linux server. Looking for the best solution. Is there a way to save all assets and then relink them all to work in the same directory?

我曾考虑过使用 curl,但我不确定如何进行所有这些操作.另外,我可能需要 PHP-DOM 吗?

I've thought about using curl, but I'm unsure of how to do all of this. Also, will I maybe need PHP-DOM?

有没有办法在服务器上使用firefox并在地址加载后复制临时文件或类似的?

Is there a way to use firefox on the server and copy the temp files after the address has been loaded or similar?

欢迎任何和所有输入.

看起来 wget 似乎不"会工作,因为需要渲染文件.我在服务器上安装了firefox,有没有办法在firefox中加载url,然后抓取临时文件并清除临时文件?

It seems as though wget is 'not' going to work as the files need to be rendered. I have firefox installed on the server, is there a way to load the url in firefox and then grab the temp files and clear the temp files after?

推荐答案

wget 可以做到,例如:

wget -r http://example.com/

这将反映整个 example.com 网站.

This will mirror the whole example.com site.

一些有趣的选项是:

-Dexample.com:不要关注其他域的链接
--html-extension: 将 text/html content-type 的页面重命名为 .html

-Dexample.com: do not follow links of other domains
--html-extension: renames pages with text/html content-type to .html

手册:http://www.gnu.org/software/wget/manual/

这篇关于在 linux 服务器上保存完整网页的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆