Download data from a webpage after putting in login credentials.
Mostrar comentarios más antiguos
I want to download multiple GPS data files form the website "https://cddis.nasa.gov/archive/gnss/data/daily/", but now I have to first login through the webpage "https://urs.earthdata.nasa.gov/home/" earthdata login page then I am redirceted to the cddis webpage. Can I login with my user credentials into the website through matlab and obtain the data structure of files availabe in the cddis site to download the linked files?
I have tried the following code:
url = 'https://urs.earthdata.nasa.gov/home/';
options = weboptions('username','myid','password','mypwd','Timeout',30);
data = webread(url,options);
This generates the variable "data" in the workspace but it contains "<!DOCTYPE html><!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"> <![endif]--><!" .
It would be a great help if anyone could help me with this.
Thanks in advance.
Respuestas (2)
Prince Kumar
el 19 de En. de 2022
0 votos
Hi,
Kindly refer to the following MATLAB answers
- https://www.mathworks.com/matlabcentral/answers/451874-how-to-download-data-from-website
- https://www.mathworks.com/matlabcentral/answers/53898-can-matlab-download-files-from-a-website
I hope the above information will be useful to you.
1 comentario
Giulio Tagliaferro
el 1 de Feb. de 2023
this does not work
Lin Yan
el 1 de Mayo de 2024
0 votos
I just used 'websave' with the following options, and it worked to download urls from earthdata.
options = weboptions('username','myid','password','mypwd','Timeout',30);
Categorías
Más información sobre Downloads en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!