如何在Linux(wget)中下载网站
wget是用于在Linux中下载网站的有用命令。 例如, wget [url] 。
[mkyong@snake ~]$ wget -r -p -k -E http://www.google.com
--2009-07-19 14:07:27-- http://www.google.com/
Resolving www.google.com... 64.233.189.104
Connecting to www.google.com|64.233.189.104|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.google.com.my/ [following]
--2009-07-19 14:07:27-- http://www.google.com.my/
Resolving www.google.com.my... 64.233.189.147
Connecting to www.google.com.my|64.233.189.147|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `www.google.com.my/index.html'
[ <=> ] 5,742 --.-K/s in 0.05s
2009-07-19 14:07:27 (102 KB/s) - `www.google.com.my/index.html' saved [5742]
FINISHED --2009-07-19 14:07:27--
Downloaded: 1 files, 5.6K in 0.05s (102 KB/s)
Converting www.google.com.my/index.html... 0-12
Converted 1 files in 0.001 seconds.
上面的命令会将“ google.com”网站下载到我们的本地驱动器中。
Wget选项说明
-r,-recursive指定递归下载。
-k,-convert-links使下载的HTML中的链接指向本地文件。
-p,–page-Requirements获取显示HTML页面所需的所有图像等。
-E,–html-extension保存带有`.html’扩展名的HTML文档。
wget中仍然有许多有用的选项,请发出man wget或wget –help来探索有关其他选项的更多信息。
标签: Unix
翻译自: https://mkyong.com/linux/how-to-download-a-website-in-linux-wget/
还没有评论,来说两句吧...