我如何使用wget下载一个子目录? 我能指定需要下载的子目录吗?
谢谢!
您可以执行以下操作:
wget -r -l1 --no-parent 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 -m -p -E -k -K -np {URL Address}
您可以使用手册了解选项的详细信息。
注意:使用先前的选项,将下载文件的索引!
wget
(GNU Wget 1.14)忽略了--no-parent
选项。在openSUSE leap 42.1.20160217中。 - boczniak767这是一个有用的信息。我尝试了:
wget -r -l1 --no-parent http://www.domain.com/subdirectory/
针对包含形如name.subname.subname2.etc.htm或.html多个文件的站点,为了捕获这些文件,我运行了以下命令:
wget -r --no-parent http://www.domain.com/subdirectory/
这样做很有效。