How do I open a website in a browser, enter login data and get the resulting page content automatically?
11 ビュー (過去 30 日間)
古いコメントを表示
Hi,
How do I open a website in a browser, enter login data and get the resulting page content automatically?
I found this:
the author wrote:
I did this:
url = 'http://www.myurl.com';
options = {'Username', 'myUsername', 'Password', 'myPassword', 'Timeout', 10};
z = webwrite(url, options);
What I get in z is just the source code of the login page. Do I have to use the URL of the login page or can I use the URL I want to go to after login? How would I get that content, when I have to use the login URL? Do I have to do something with a cookie? Could it be that the website which I try to login do not support RESTful API? How can I find out?
I have same questions and did not find the answers. Who can help?
0 件のコメント
回答 (1 件)
Eric Delgado
2022 年 3 月 17 日
Hi! You can use webread and weboptions together. And you must point to the page that you want to download (HTML code or json text, for example).
message = webread('www.myurl.com', weboptions('Username', 'YourUsername', 'Password', 'YourPassword'))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!