我试图下载一个项目的文件使用 wget,因为该项目的 SVN 服务器不再运行,我只能通过浏览器访问文件。所有文件的基 URL 与
wget
Http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/
如何使用 wget(或任何其他类似的工具)下载这个存储库中的所有文件,其中“ tzivi”文件夹是根文件夹,下面有几个文件和子文件夹(高达2或3级) ?
你可以在 shell 中使用:
wget -r --no-parent http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/
参数如下:
-r //recursive Download
还有
--no-parent // Don´t download something from the parent directory
如果你不想下载全部内容,你可以使用:
-l1 just download the directory (tzivi in your case) -l2 download the directory and all level 1 subfolders ('tzivi/something' but not 'tivizi/somthing/foo')
如果没有插入 -l选项,wget将自动使用 -l 5。
-l
-l 5
如果你插入一个 -l 0,你将下载整个互联网,因为 wget将遵循它找到的每个链接。
-l 0
您可以在 shell 中使用它:
wget -r -nH --cut-dirs=7 --reject="index.html*" \ http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/
-r recursively download -nH (--no-host-directories) cuts out hostname --cut-dirs=X (cuts out X directories)
使用命令
wget -m www.ilanni.com/nexus/content/
你也可以使用以下命令:
wget --mirror -pc --convert-links -P ./your-local-dir/ http://www.your-website.com
这样你就可以得到你想下载的网站的精确镜像
这种方法是有效的:
wget -m -np -c --no-check-certificate -R "index.html*" "https://the-eye.eu/public/AudioBooks/Edgar%20Allan%20Poe%20-%2"
wget -r --no-parent URL --user=username --password=password
如果您有下载的用户名和密码,最后两个选项是可选的,否则不需要使用它们。
您还可以在链接 https://www.howtogeek.com/281663/how-to-use-wget-the-ultimate-command-line-downloading-tool/中看到更多选项
这个链接给了我最好的答案:
$ wget --no-clobber --convert-links --random-wait -r -p --level 1 -E -e robots=off -U mozilla http://base.site/dir/
非常有效。
这会有帮助的
wget -m -np -c --level 0 --no-check-certificate -R"index.html*"http://www.your-websitepage.com/dir
试试这个工作代码(30-08-2021) :
!wget --no-clobber --convert-links --random-wait -r -p --level 1 -E -e robots=off --adjust-extension -U mozilla "yourweb directory with in quotations"
我不能让这个起作用。 无论我尝试什么,我只是得到一些 http 文件。
只要查看下载目录的命令就可以了吗? 一定有更好的办法。 Wget 似乎不适合这个任务,除非它完全失败。