websave not working properly and giving error "IP address could not be determined"
조회 수: 7 (최근 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에서 Web Services에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!