从目录中获取图像
嘿。 我有一个公共目录,其中包含许多 JPG 图像。如何使用 WGET
将每张图片下载到本地计算机上的特定目录中?谢谢
Hey.
I have a public directory that contains a number of JPG images. How can I use WGET
in order to download each picture into a specific directory on my local machine? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
wget -r --directory-prefix=/path/to/save/to -A jpg www.example.com/path/to/image/directory
全部来自 wget 手册
-A
参数允许您指定文件名后缀你关心的(还有一个类似的-R
来排除文件):-r
是递归检索,所以它会进入子目录。--directory-prefix=/path
指定保存位置。对于
-A
标志,我将从手册中截取一段代码:-A acclist --accept acclist
-R rejlist --reject rejlist
wget -r --directory-prefix=/path/to/save/to -A jpg www.example.com/path/to/image/directory
All from the wget manual
The
-A
argument allows you to specify the file name suffixes that you care about (there's also a similar-R
to exclude files):-r
is recursive retrieval, so it will go into subdirectories.--directory-prefix=/path
specifies where to save to.And the
-A
flag, I'll cut a snippet from the manual:-A acclist --accept acclist
-R rejlist --reject rejlist
首先,确保您的服务器上有目录列表(恕我直言,这不是一个好的设置)。
接下来,让 wget 获取此列表,以某种方式解析它,最后 wget 每个图像。
First of, ensure you have directory listing on your server (not a good setting imho).
Next, make wget get this listing, parse it somehow and finally wget each image.