|
-
Mar 30th, 2006, 09:45 AM
#1
Thread Starter
Member
auto fill on the web forms..
I'm still some trouble and not get anywhere, I'm writing program of automatically fill out the forms for (first name and last name and home addresss) on the web browser by click one button and automatically fill out, I'm not sure how i can write code in VB. Does any one can help me how to write that so i can undersand myself from there thanks.
-
May 30th, 2006, 08:26 PM
#2
Re: auto fill on the web forms..
This will log you into gamespot, might gets some ideas fom it,
VB Code:
Option Explicit
Private WithEvents strtxtBox As HTMLTextAreaElement
Private IE As InternetExplorer
Private WithEvents strEmail As HTMLTextAreaElement
Private Sub Command1_Click()
Set IE = New InternetExplorer
With IE
.Visible = True
.navigate "www.gamespot.com"
End With
Do Until IE.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Set strtxtBox = IE.document.Forms(0).PASSWORD
Set strEmail = IE.document.Forms(0).EMAILADDR
strtxtBox.innerText = "pass"
IE.document.frames.execScript "document.login.submit()", "JavaScript"
End Sub
Creates a new instance of IE but can use it with the WB control, change a couple of lines.
You need to set references for "Microsoft Internet controls" and "Microsoft HTML Object library".
-
May 30th, 2006, 11:05 PM
#3
Re: auto fill on the web forms..
you dont need the withevents ....
(dont even need the HTML object in some cases)
using the webbrowser control
Webbrowser1.Document.All.NAMEOFFIELD.Value = "Data"
so, if in the HTML source of the page.. u see the text field Name="fName" then
Webbrowser1.Document.All.fName.Value = "Data"
to submit
Webbrowser1.Document.All.submit.Click
usually works.
now u can get really deep into things sometimes.. all depends on the page being filled.
post the URL and I will help more in the am
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
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
|