bash Linux:WGET - 缺少使用 -i 选项的方案
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16674819/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Linux: WGET - scheme missing using -i option
提问by Guilherme Salomé
I am trying to download multiple files from yahoo finance using wget.
我正在尝试使用 wget 从雅虎财经下载多个文件。
To do that i used a python script to generate a text file with all urls that i need. When downloading a single file (a csv file) using the following code:
为此,我使用了一个 python 脚本来生成一个包含我需要的所有 url 的文本文件。使用以下代码下载单个文件(csv 文件)时:
wget ichart.finance.yahoo.com/table.csv?s=BIOM3.SA&a=00&b=5&c=1900&d=04&e=21&f=2013&g=d&ignore=.csv
everything goes OK! However, when the option -i is added and instead of reading the url directly, but instead reading it from the file, i get the error:
一切顺利!但是,当添加选项 -i 并且不是直接读取 url 而是从文件中读取它时,我收到错误消息:
Invalid URL ichart.finance.yahoo.com/table.csv?s=BIOM3.SA&a=00&b=5&c=1900&d=04&e=21&f=2013&g=d&ignore=.csv: Scheme missing
The file that contains the urls is a text file with a single url in each line. The urls are exactly like the one in the first example, but with some different parameters.
包含 url 的文件是一个文本文件,每行只有一个 url。网址与第一个示例中的网址完全相同,但具有一些不同的参数。
Is there a way to correct this?
有没有办法纠正这个问题?
Thanks a lot for reading!!
非常感谢阅读!!
采纳答案by Guilherme Salomé
To solve the problem I added double-quotes on the links and a web protocol. For example:
为了解决这个问题,我在链接和网络协议上添加了双引号。例如:
"http://ichart.finance.yahoo.com/table.csv?s=BIOM3.SA&a=00&b=5&c=1900&d=04&e=21&f=2013&g=d&ignore=.csv"
"http://ichart.finance.yahoo.com/table.csv?s=BIOM3.SA&a=00&b=5&c=1900&d=04&e=21&f=2013&g=d&ignore=.csv"

