MATLAB: Websave adds html to file name

coronaviruswebsave

Any reason why 'websave' adds a '.html' to the name of the output file?
I'm downloading coronavirus data from John Hopkins University github. I use websave as recomended. No matter what I do, the saved file has a '.html' added after the '.csv'. My code is as follows:
url= 'https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series/';
fileinf= 'time_series_covid19_confirmed_global.csv';
websave(fileinf,url);
The file that is saved has name:
time_series_covid19_confirmed_global.csv.html
Any solutions?
Thanks

Best Answer

Because URL you mentioned corresponds to a webpage, not a CSV file.
Try the following code.
url = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv';
fileinf= 'time_series_covid19_confirmed_global.csv';
websave(fileinf,url);
Related Question