如何在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 wgetwget –help来探索有关其他选项的更多信息。

翻译自: https://mkyong.com/linux/how-to-download-a-website-in-linux-wget/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值