How can I get MATLAB to log in to a website and then grab data?

6 views (last 30 days)
If my code looks like this:
url = 'example url';
options = weboptions('Timeout',360); %6 min timeout
outfilepath = websave('Export 1.csv',Turl,options);
filename = 'Export 1.csv';
I can get data to a spreadsheet. But the url I'm working with links to a password protected data set, so I tried to write it like this:
main_url = 'example main url';
login_url = 'url to screen with login prompt';
webwrite(login_url,'userid','example username','password','example password');
options = weboptions('Timeout',360); %6 min timeout
outfilepath = websave('Export 2.csv',TGIN_url,options);
filename = 'Export 2.csv';
But I still get the same export that does not contain the data I want. Is there any way to get MATLAB to login to the website and then grab the data?
Thanks!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!