MATLAB Answers

Downlaoding data from a webpage

5 views (last 30 days)
Abhinav on 27 Jan 2018
Commented: Abhinav on 28 Jan 2018
I want to save the data shown on USGS webpage: USGS data using Matlab. I am using MatLab 2014a; therefore, I have to use 'urlwrite' function. When I use it, I get the HTML content, not the data in txt format. Any suggestions on how do I download the data that is available on the link? I used the following code:
outfilename = urlwrite(url,filename);


Show 1 older comment
Abhinav on 27 Jan 2018
I have edited the question to include the code.
Rik on 27 Jan 2018
I tested this code on R2012b and I'm getting an error with the https ("Error downloading URL. Your network connection may be down or your proxy settings improperly configured."), and the html you describe when I switch to http.
Have you tried saving a capture to the Wayback Machine? That sometimes solve http/https errors for me. You can try out this FEX submission.
Abhinav on 27 Jan 2018
Okay, I will try to work it out using your suggestion. Thanks!

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 28 Jan 2018
Remove the trailing '/' in your URL.

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.