Hello. New to this forum and fairly new to Visual Basic.
I am writing some
VB code to automatically load and log on to a web page.
Using the web browser navigate function the following code will load the web page
https://www.tomwaterhouse.com/ then enter my user name , then password and then click(submit) the login button.
My problem is that once logged on to the web page I do know how to activate the âGreyhoundsâ button to take me to the next page.
Any Help would be appreciated.
************************************************** ****
Public Class Form1
Dim flagg As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("https://www.tomwaterhouse.com/")
flagg = "login"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
******* need to put code here to click Greyhounds button
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles WebBrowser1.DocumentCompleted
If flagg = "login" Then
WebBrowser1.Document.GetElementById("UserID").SetA ttribute("Value", "UserName")
WebBrowser1.Document.GetElementById("Password").Se tAttribute("Value", "Password")
WebBrowser1.Document.GetElementById("LogonForm").I nvokeMember("submit")
End If
flagg = ""
End Sub