|
-
Jan 24th, 2007, 07:27 PM
#1
Thread Starter
Lively Member
[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
-
Jan 24th, 2007, 10:20 PM
#2
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
Last edited by kleinma; Jan 24th, 2007 at 10:26 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|