Vote count:
0
I have created a 'script' which will allow me to automatically log into a website and get account information. However when I request the 'DocumentText' the content is the login content. It has not updated itself.
I have tried to prevent this by allowing the page to do it's process;
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
Application.DoEvents();
This doesn't work. My full code can be seen below;
webBrowser1.Navigate(loginUrl);
waitForBrowser();
if (!webBrowser1.DocumentText.Contains("<div id=\"mh_h1\"><h1 class=\"hmain\">Sign In</h1></div>"))
return;
setInputValue("email", "myemail@yahoo.com");
setInputValue("password", "mypassword");
webBrowser1.Document.GetElementById("login-form-contBtn").InvokeMember("click");
waitForBrowser();
MessageBox.Show(webBrowser1.DocumentText);
The form works as I can see it on the GUI. I am able to login, just the MessageBox shows the login page not the main page.
asked 54 secs ago
C# WebBrowser auto submit form
Aucun commentaire:
Enregistrer un commentaire