Well this script is working partially, when the script submit the login a MsgBox("The login is wrong!") appeared, but when the page load a MsgBox("The login is ok!") appears.
Why the "The login is wrong!" is appearing? Can someone fix for me or tell me another way to do that?
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If WebBrowser1.Url.AbsoluteUri = "https://steamcommunity.com/login/" Then
WebBrowser1.Document.GetElementById("steamAccountName").SetAttribute("Value", "gogost")
WebBrowser1.Document.GetElementById("steamPassword").SetAttribute("Value", "gogost")
WebBrowser1.Document.Forms(1).InvokeMember("submit")
End If
If Me.WebBrowser1.DocumentText.Contains("LogOut") Then
MsgBox("The login is ok!")
Else
MsgBox("The login is wrong!")
End If