[RESOLVED] [2005] Webbrowser - Find form
I've seen this before so i know it's possible.
I have a webbrowser and once it's navigated to a certain page, i want it to find a certain textbox (username), type something in it, find the password textbox, type something in there and then click on submit.
what kind of code would i use for this sort of thing?
Thanks,
Phil
Re: [2005] Webbrowser - Find form
if the page is in frames it probably won't work, but if its not, then you can use this code.
VB Code:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
WebBrowser1.Document.All("txtUser").SetAttribute("value", "myusername")
WebBrowser1.Document.All("txtPassword").SetAttribute("value", "mypassword")
WebBrowser1.Document.All("btnSubmit").InvokeMember("click")
End Sub