I have tried to use the code you provided
Dim link As String = webbrowser1.Document.GetElementById("id of link").GetAttribute("href")
webbrowser1.Navigate(New Uri(link))
My original handler looks like this
Private Sub webbrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)
AddHandler CType(sender, WebBrowser).Document.Window.Error, AddressOf Window_Error
If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
WebBrowser1.Document.All("pass").SetAttribute("value", Password)
WebBrowser1.Document.All("email").SetAttribute("value", email1)
WebBrowser1.Document.Forms(0).InvokeMember("submit")
End If
End Sub
It will navigate to the log in page, submit password and email and navigate to the next page and stop.
When I change it like this.
Private Sub webbrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)
Dim link As String = WebBrowser1.Document.GetElementById("id of link").GetAttribute("href")
AddHandler CType(sender, WebBrowser).Document.Window.Error, AddressOf Window_Error
If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
WebBrowser1.Document.All("pass").SetAttribute("value", Password)
WebBrowser1.Document.All("email").SetAttribute("value", email1)
WebBrowser1.Document.Forms(0).InvokeMember("submit")
WebBrowser1.Navigate(New Uri(link))
End If
End Sub
It just navigates to the login page and enters email and stops.
I am obviously implementing the new navigation incorrectly.