command-line - 如何用 wget 解决空的 index.html 问题?

标签 command-line download wget

我想下载远程服务器上文件夹中的所有文件我在 Windows 客户端上使用 Wget 我的命令是:

>wget -r http://www.example.com/getfeed/d165161dasdvc561551as1v6/soccerfixtures/england/

这一行给我 index.html 大小(0 KB)。

我当时用过:

>wget -r --reject "index.html*" http://www.example.com/getfeed/d165161dasdvc561551as1v6/soccerfixtures/england/

现在即使我排除了 index.html 我也没有得到任何文件 我仍然没有下载任何文件 谁能帮我解决这个问题并告诉我为什么?

最佳答案

这只有在另一端的 Web 服务器配置为提供目录列表时才有效。并非所有服务器都以这种方式配置。大多数情况下会自动将您重定向到您要求 wget 忽略的 index.html、index.php 等。

在第一种情况下,如果您不忽略 index.html,wget 将只跟踪该页面中的链接。由于 Web 服务器返回的 index.html 的大小为零,因此 wget 没有链接可跟踪,它终止。 Wget 无法明确知道目录中有哪些文件。

编辑地址评论:

$ wget -i 下载文件列表.txt

关于command-line - 如何用 wget 解决空的 index.html 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15298240/

相关文章:

安卓 : Exception coming when download file from AmazonS3

python - 为什么 os 模块不运行 wget cmd 命令?

linux - 创建文件 :///URI based on the file's directory (pwd) 的 Unix 命令

python - Python 中的子进程文件操作

shell - 在同一个 shell golang 中运行多个 Exec 命令

.net - 使用 SSH.NET (VB.NET) 将文件下载到字节数组

ios - TACO 不会使用指定的 --device 参数远程构建 ios

javascript - 如何通过JS下载iphone中的几个文件?

c - 某些情况下的段错误(核心已转储)

python - 移动友好测试脚本