我正在尝试使用wget
下载一个项目的文件,因为该项目的SVN服务器已经停止运行,我只能通过浏览器访问这些文件。所有文件的基本URL都相同,比如:
http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/*
我该如何使用wget
(或其他类似的工具)下载该存储库中的所有文件,其中“tzivi”文件夹是根文件夹,并且在其下面有多个文件和子文件夹(最多有两到三级)?
我正在尝试使用wget
下载一个项目的文件,因为该项目的SVN服务器已经停止运行,我只能通过浏览器访问这些文件。所有文件的基本URL都相同,比如:
http://abc.tamu.edu/projects/tzivi/repository/revisions/2/raw/tzivi/*
我该如何使用wget
(或其他类似的工具)下载该存储库中的所有文件,其中“tzivi”文件夹是根文件夹,并且在其下面有多个文件和子文件夹(最多有两到三级)?
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 0
,您将下载整个互联网,因为wget
将跟随它找到的每个链接。
wget -r -l1 --no-parent http://www.stanford.edu/~boyd/cvxbook/cvxbook_additional_exercises/
是我的答案。谢谢你的回答。 - isomorphismeshttp://websitename.com/wp-content/uploads/2009/05
获取所有文件,但我只得到了一个没有任何内容的index.html
文件。我搞不清楚我错过了什么。 - Vivek Todi-e robots=off
开关非常有用。;) - Matthias W.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 --no-clobber --convert-links --random-wait -r -p --level 1 -E -e robots=off -U mozilla http://base.site/dir/
运行得非常顺畅。
使用命令
wget -m www.ilanni.com/nexus/content/
wget -r --no-parent URL --user=username --password=password
wget --mirror -pc --convert-links -P ./your-local-dir/ http://www.your-website.com
这样可以确保您下载的网站镜像与原网站完全一致。
try this working code (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似乎不适合这个任务,除非它完全失败了。
这个有效:
wget -m -np -c --no-check-certificate -R "index.html*" "https://the-eye.eu/public/AudioBooks/Edgar%20Allan%20Poe%20-%2"
wget -m -np -c --level 0 --no-check-certificate -R"index.html*"http://www.your-websitepage.com/dir