首页 > 解决方案 > 仅使用 wget 下载文本文件

问题描述

使用wget是否可以为特定文件类型蜘蛛主机?我正在从 FTP 归档一些文档,我需要让它抓取整个主机只下载.txt文件。

我试过这样:

wget mysite.com/ftplist --config=./.wgetrc

具有以下内容.wgetrc

accept = txt
check_certificate = off
connect_timeout = 3
cookies = off
dns_cache = off
follow_ftp = on
logfile = amz.log
max_redirect = 3
no_clobber = on
recursive = on
save_headers = on

这将调用mysite.com/ftplist. 此页面包含ftp://列表中的 URL。wget向此页面发出请求,但不会继续进行,并且似乎停止在该页面上。

这里是amz.log

Saving to: ‘mysite.com/ftplinks/index.html.tmp’

 0K .......... .......... .......... .......... ..........  656K
50K .......... .......... .......... .......... ..........  741K
100K .......... .......... .......... .......... .......... 1.12M
150K .......... .......... .......... .......... ..........  975K
200K .......... .......... .......... .......... ..........  935K
250K .......... .......... .......... .......... ..........  835K
300K .......... .......... .......... .......... ..........  870K
350K .......... .......... .......... .......... .......... 1.07M
400K .......... .......... .......... .......                907K=0.5s

2018-12-20 17:55:54 (881 KB/s) - ‘mysite.com/ftplinks/index.html.tmp’ saved [447555]

Removing mysite.com/ftplinks/index.html.tmp since it should be rejected.

我错过了什么吗?

标签: ftpwget

解决方案


推荐阅读