wget不递归下载文件

Abhimanyu撒哈拉沙漠

我在该网站上看到了一些有关如何递归从目录下载文件的文章。因此,我执行了以下代码行:

wget -r -nH --cut-dirs=3 -A '*.bz2' -np http://www.xfce.org/archive/xfce-4.6.2/src/

它仅下载索引页面,然后自动将其删除。

输出:

--2016-07-01 16:56:02--  http://www.xfce.org/archive/xfce-4.6.2/src/
Resolving www.xfce.org (www.xfce.org)... 138.48.2.103
Connecting to www.xfce.org (www.xfce.org)|138.48.2.103|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://archive.xfce.org/xfce/4.6.2/src/ [following]
--2016-07-01 16:56:17--  http://archive.xfce.org/xfce/4.6.2/src/
Resolving archive.xfce.org (archive.xfce.org)... 138.48.2.107
Connecting to archive.xfce.org (archive.xfce.org)|138.48.2.107|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html                                [ <=>                                                                      ]   8.05K  --.-KB/s   in 0.03s  

2016-07-01 16:56:23 (247 KB/s) - ‘index.html’ saved [8239]

Removing index.html since it should be rejected.

FINISHED --2016-07-01 16:56:23--
Total wall clock time: 21s
Downloaded: 1 files, 8.0K in 0.03s (247 KB/s)

Web目录包含许多tar.bz2文件。谁能告诉我我要去哪里错了?

我的wget版本是 1.16.3

咖啡杯

似乎通过HTTP获得目录列表并非易事;我可以bz2使用以下文件获取文件:

wget -k -l 0 "http://archive.xfce.org/xfce/4.6.2/src/" -O index.html ; cat index.html | grep -o 'http://archive.xfce.org/xfce/4.6.2/src/[^"]*.bz2' | uniq -c | xargs wget

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章