websave not working properly and giving error "IP address could not be determined"
2 次查看(过去 30 天)
显示 更早的评论
I am using MATLAB R2018a and want to read and copy the content from a url and write it in a .txt file. but websave is not working properly and giving the error mentioned below. it is basically removing "/" from the url due to which url is not found. I am not getting why it is responding like this ....
CODE
bundle_url = 'http://data.votchallenge.net/vot2016/main/description.json';
data = webread(bundle_url)
ERROR
Error using webread (line 122)
The IP address of "data.votchallenge.netvot2016maindescription.json" could not be determined.
I have also tried urlwrite but it is only returning the word "Found" in the .txt file.
Furthermore, I have tried the code given by Matlab Examples but it is also giving the same error.
MATLAB EXAMPLE
api = 'http://climatedataapi.worldbank.org/climateweb/rest/v1/';
url = [api 'country/cru/tas/year/USA'];
S = webread(url)
ERROR
Error using webread (line 122)
The IP address of "climatedataapi.worldbank.orgclimatewebrestv1countrycrutasyearUSA" could not be determined.
Can anyone help me with this issue ??? any type of help will be appreciated. Thankyou in advance for your time and help. :)
0 个评论
回答(1 个)
Swapnil Tatiya
2023-7-11
Could you please try the same code with latest matlab version, because when I run it on matlab online I'm able to fetch the data from the links.
Hope this helps.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!