Invalid URL Error with valid URL
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Janice Sanderson
am 1 Feb. 2016
Kommentiert: Janice Sanderson
am 1 Feb. 2016
Hello, I am trying to extract data with the websave function from an api, with an url I am certain is valid and correct when I type it into a browser. However, MATLAB seem to not recognize the url as a valid one. The weird thing is that somehow it works when I remove the last part "&timeformat=%Y%m%d%H".
And there's the simple code that I'm using to extract the numbers:
clc
clear all
api = 'http://api.mesowest.net/v2/stations/timeseries?stid=knyc&start=201001010000&end=201512312359&token=1234567890&vars=air_temp,relative_humidity&timeformat=%Y%m%d%H'; filename = 'KNYC.txt'; options = weboptions('Timeout',Inf); outfilename = websave(filename,api,options);
Thanks in advance!
Yilan
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 1 Feb. 2016
You need to percent encode your percent symbols. Change the % to %25 in each location
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Scope Variables and Generate Names finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!