download file from a url
15 次查看(过去 30 天)
显示 更早的评论
I am trying to download a file from the following URL
If I enter this request in Chrome, the file will be downloaded automatically.
I have tried to use websave, which gives the following
options.Timeout = Inf;
websave('xxx.csv','https://sdw-wsrest.ecb.europa.eu/service/data/YC/B.U2.EUR.4F.G_N_C.SV_C_YM.?startPeriod=2020-08-31&endPeriod=2020-08-31&format=csvdata',options)
Error using websave (line 94)
The connection to URL 'https://sdw-wsrest.ecb.europa.eu/service/data/YC/B.U2.EUR.4F.G_N_C.SV_C_YM.?startPeriod=2020-08-31&endPeriod=2020-08-31&format=csvdata' timed out
after 2147.4830000000002 seconds. Set options.Timeout to a higher value.
Can anyone help,please?
2 个评论
采纳的回答
stozaki
2020-9-8
Hello Xuewei,
Your script seems to have invalid websave arguments.
Please try following script.
websave('xxx.csv','https://sdw-wsrest.ecb.europa.eu/service/data/YC/B.U2.EUR.4F.G_N_C.SV_C_YM.?startPeriod=2020-08-31&endPeriod=2020-08-31&format=csvdata','Timeout',Inf)
or
options.Timeout = Inf;
websave('xxx.csv','https://sdw-wsrest.ecb.europa.eu/service/data/YC/B.U2.EUR.4F.G_N_C.SV_C_YM.?startPeriod=2020-08-31&endPeriod=2020-08-31&format=csvdata','Timeout',options.Timeout)
Regards,
stozaki
3 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!