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

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

WBOY
WBOYOriginal
2016-06-06 20:32:061871browse

有以下网址列表:

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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn