How do I open a website in a browser, enter login data and get the resulting page content automatically?

I have seen that there is this 'webwrite' function. But I do not know how to get the correct labels of the login boxes and how to enter strings there. Is there a different function for this?

回答 (1 件)

Dasharath Gulvady
Dasharath Gulvady 2015 年 10 月 2 日
編集済み: Dasharath Gulvady 2015 年 10 月 2 日
If you are web service requires authentication, you can pass the username and password using weboptions with webwrite:

1 件のコメント

Gunn711
Gunn711 2015 年 10 月 2 日
編集済み: Gunn711 2015 年 10 月 2 日
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?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

2015 年 9 月 30 日

編集済み:

2015 年 10 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by