How can I get MATLAB to log in to a website and then grab data?
6 views (last 30 days)
Show older comments
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!
1 Comment
Answers (0)
See Also
Categories
Find more on Low-Level File I/O in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!