Heim  >  Artikel  >  Backend-Entwicklung  >  我需要批量下载服务器上的文件,并保存在本地,该怎么写一个脚本?

我需要批量下载服务器上的文件,并保存在本地,该怎么写一个脚本?

WBOY
WBOYOriginal
2016-06-06 20:32:061869Durchsuche

有以下网址列表:

http://www.test.com/download/1/
http://www.test.com/download/2/
http://www.test.com/download/3/
http://www.test.com/download/4/
...
...
...
http://www.test.com/download/100/

访问以上每条网址都返回一个文件,可能是png、zip,浏览器访问则会自动下载。

现在我需要一个脚本程序,可以批量下载它们,并且保存到本地文件夹,文件夹如下:

1
2
3
4
...
...
...
100

请问大神,能否用脚本程序实现这个过程?我是windows系统,已经安装了python、php和node.js

回复内容:

有以下网址列表:

http://www.test.com/download/1/
http://www.test.com/download/2/
http://www.test.com/download/3/
http://www.test.com/download/4/
...
...
...
http://www.test.com/download/100/

访问以上每条网址都返回一个文件,可能是png、zip,浏览器访问则会自动下载。

现在我需要一个脚本程序,可以批量下载它们,并且保存到本地文件夹,文件夹如下:

1
2
3
4
...
...
...
100

请问大神,能否用脚本程序实现这个过程?我是windows系统,已经安装了python、php和node.js

<code>wget -r
</code>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn