wget-下载子目录

wget-下载子目录,wget,Wget,如何使用wget仅下载子目录? 我可以指定需要下载的子目录吗 谢谢 您可以执行以下操作: wget-r-l1——没有父级http://www.domain.com/subdirectory/ 其中: -r: recursive retrieving -l1: sets the maximum recursion depth to be 1 --no-parent: does not ascend to the parent; only downloads from the specified s

如何使用wget仅下载子目录? 我可以指定需要下载的子目录吗

谢谢

您可以执行以下操作:

wget-r-l1——没有父级http://www.domain.com/subdirectory/

其中:

-r: recursive retrieving
-l1: sets the maximum recursion depth to be 1
--no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy
您可以使用手册页了解选项的详细信息


注意:使用前面的选项,将下载文件索引

我能使用的信息很好。我试过:

wget -r -l1 --no-parent http://www.domain.com/subdirectory/ wget-r-l1--没有父级http://www.domain.com/subdirectory/ 在包含多个格式为name.subname.subname2.etc.htm或.html的文件的网站上。为了捡起这些,我跑了:

wget -r --no-parent http://www.domain.com/subdirectory/ wget-r--没有父级http://www.domain.com/subdirectory/
这很好。

感谢您对命令参数进行了详细分析。我也遇到了类似的问题,但只需要-r和--no parent命令。如果您希望确保每个页面都能正确加载(即:下载页面上加载的图像),可以在上述命令中添加-p标志。此外,添加
-nd
将文件直接保存在当前目录中,而不使用/path/to/the/subdirectory.-nH--cut dirs以不下载整个路径树。疯狂。正是我要找的。这应该是公认的答案。在我的情况下,这个解决方案失败了(构建在linux GNU上的GNU Wget 1.13.4)。它实际上是下载父目录中的文件——不是期望的结果。在我的情况下,它也失败了。似乎我的
wget
(GNU wget 1.14)忽略了
——无父选项。在openSUSE leap 42.1.20160217-m中:适用于镜像的选项,如无限递归和时间戳-p:页面要求-E:调整扩展名-k:转换本地查看的链接-k:备份原始文件,不要删除-np:无父级
wget -r --no-parent http://www.domain.com/subdirectory/