|
-
Jul 18th, 2006, 03:31 PM
#1
Thread Starter
Lively Member
Web form filler help
sorry i couldnt think of a good way to explain this in the title. anyways what i want to do is select a site/server in a combo box and click create. it will then fill in that form for example name password bday zip etc etc. look here for what i mean Example
the "code" to verify the registration obviously will need to pop up in a new box. ive been searchin for days tryin to find a good example or help on this and cant find it. so just to recap i want the program to go to links when selected in a combo box link1 link2 and so on. those last links if u look at them u will notice the program also has to "click" the sign up button first. this is just something im tryin to learn as i see alot of these type programs about and always wondered and been trying to figure it out without much luck. anybody got any help for me? would be greatly appreciated
-
Jul 18th, 2006, 03:55 PM
#2
Re: Web form filler help
take a look at the tutorial in my sig....
it depends on the webpage as to what u need to do.
here.. this will start u off... u need to dig through the source and find the name of each field:
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate "http://edit.tpe.yahoo.com/config/eval_register?.intl=us&new=1&.done=http%3A//my.yahoo.com&.src=&.v=0&.u=4caqf312bqg3i&partner=&.partner=&.p=&promo=&.last="
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Application) Then
WebBrowser1.Document.All.Item(".fn").Value = "First Name"
WebBrowser1.Document.All.Item(".ln").Value = "Last Name"
WebBrowser1.Document.All.Item(".intl").Value = "uk"
WebBrowser1.Document.All.Item(".sx").Value = "m"
WebBrowser1.Document.All.Item("login").Value = "LOGIN NAME"
WebBrowser1.Document.All.Item(".pw").Value = "Password"
WebBrowser1.Document.All.Item(".pw2").Value = "Password"
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jul 18th, 2006, 04:11 PM
#3
Thread Starter
Lively Member
Re: Web form filler help
thanks static that filled in the first part but how do you select options? for instance the "question" part in the combo box how would vb6 automatically select the question from the combo box. ur tutorial which is very good actually it will help me with something else too didnt go into the object of select anything from a combo box automatically
sorry i got it it was
VB Code:
WebBrowser1.Document.All.Item("pwq").Value = "What is your fathers middle name?"
Last edited by ally01; Jul 18th, 2006 at 04:17 PM.
-
Jul 18th, 2006, 05:00 PM
#4
Thread Starter
Lively Member
Re: Web form filler help
okay im havin a slight problem now locatin which info i need to fill in the "title" field after i select industry.. ive tried
VB Code:
WebBrowser1.Document.All.Item(".job").Value = "Analyst"
also
VB Code:
WebBrowser1.Document.All.Item(".job").Value = "Analyst;22"
and also 22 on its own
now i have another new problem i closed it to run out to the store and came back and opened the saved project i did have
VB Code:
WebBrowser1.Document.All.Item(".ind").Value = "25"
which selected the industry but not the "job title" but i could manually select the job title now its blank and ive tried changin it etc but it just remains blank so obviously i need advise on what i did wrong there if anyone can help
Last edited by ally01; Jul 18th, 2006 at 06:58 PM.
-
Jul 18th, 2006, 07:09 PM
#5
Thread Starter
Lively Member
Re: Web form filler help
how would i also get the "verification word" to pop up in a new window with a textbox below it so i can type it in as it changes each time so i can type the letters into a textbox and press okay and it sends it..
-
Jul 19th, 2006, 08:56 AM
#6
Re: Web form filler help
ok.. industry hard one since it calls code on change...
here is the codeto fill out the industry/job etc... (All the codes are in the source u just need to find them
the it loads the image into a picturebox... you just need to put the picbox on a form with the textbox
I tried to force a used code... by changing values... but it didnt like it.
so that still needs to be done manually
code to download image
VB Code:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
code to fill out the rest (You need a reference to the HTML Object library)
VB Code:
WebBrowser1.Document.All.Item(".ind").Value = "21"
WebBrowser1.Document.All.Item(".ind").onchange
WebBrowser1.Document.All.Item(".job").Value = "34"
WebBrowser1.Document.All.Item(".job").onchange
WebBrowser1.Document.All.Item(".spe").Value = "10"
Dim HTML As HTMLDocument
Dim IMG As HTMLImg
Set HTML = WebBrowser1.Document
For Each IMG In HTML.images
If IMG.alt = "Registration Verification Code" Then
IMG.src = "http://ab.login.yahoo.com/img/R62hJeVZFenctOY3wTLxw1uvrmIVjvgq098E4svT8EiavO8hwl42Qzn5xAmmXFZMyTwWHBlrKO_a.jpg"
DownloadFile IMG.src, "C:\tmp.jpg"
If Len(Dir("C:\tmp.jpg")) <> 0 Then
Picture1.Picture = LoadPicture("c:\tmp.jpg")
Exit For
End If
End If
Next
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jul 19th, 2006, 05:03 PM
#7
Thread Starter
Lively Member
Re: Web form filler help
thanks static once again.. is there anyway i can get the "img src" to read from the webpage as the link for the img src as it changes all the time. so i would need it to grab it from the browser. for example its ab.login.yahoo.com/img/R62hJeVZFenctOY3wTLxw1uvrmIVjvgq098E4svT8EiavO8hwl42Qzn5xAmmXFZMyTwWHBlrKO_a.jpg in the program but when i open it it could be ab.login.yahoo.com/img/adsdzvdsvY3wTLxw1uvrmIVjvgq098E4svT8EiavO8hwl42Qzn5xAmmXFZMyTwWHBlrKO_a.jpg etc. also i get a run time error '438': Object doesnt support this property or method and it highlights this line
VB Code:
WebBrowser1.Document.All.Item(".ind").onchange
i think it might be cause the ID is taken as i manually change it to try it.
Last edited by ally01; Jul 19th, 2006 at 05:12 PM.
-
Jul 19th, 2006, 05:14 PM
#8
Thread Starter
Lively Member
Re: Web form filler help
[LEFT]i found this code on the net would i be able to use it for the secret word...
VB Code:
Option Explicit
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
With Socket
.Close
'.Connect "216.109.127.6", 80
.Connect "edit.my.yahoo.com", 80
End With
End Sub
Private Sub Socket_Connect()
Socket.SendData "GET /config/isp_ab_url?.format=jpg HTTP/1.1" & vbCrLf & "Referer: https://edit.yahoo.com/config/isp_suggest_email" & vbCrLf & "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*" & vbCrLf & "Accept-Encoding: gzip, deflate" & vbCrLf & "Accept-Language: en-us" & vbCrLf & "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)" & vbCrLf & "Host: edit.yahoo.com" & vbCrLf & "Cache-Control: no-cache" & vbCrLf & vbCrLf
End Sub
Private Sub Socket_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Dim TargetLink As String
Dim TargetLink1 As String
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim SecData As String
If (Socket.State = sckConnected) Then
Socket.GetData Data, vbString, bytesTotal
If (InStr(1, Data, "url: ", vbTextCompare) <> 0) Then
TargetLink = Mid$(Data, InStr(1, Data, "url: ") + 5, InStr(1, Data, Chr$(&HA) & "secdata:") - 7)
SecData = Mid$(Data, InStr(1, Data, "secdata: ") + 9, Len(Data) - 2)
a = Len(TargetLink)
b = Len(SecData)
c = a - b - 10
TargetLink1 = Left$(TargetLink, c)
Call URLDownloadToFile(0, TargetLink1, App.Path & "\Image.jpg", 0, 0)
Image1.Picture = LoadPicture(App.Path & "\Image.jpg")
Text1 = TargetLink1
End If
End If
End Sub
Private Sub Socket_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox Description, vbOKOnly, "yep...its an error alright"
End Sub
=
if i can what apart from the link to "yahoo" do i change? it just uses a image box text box command button and winsock control
Last edited by ally01; Jul 19th, 2006 at 05:18 PM.
-
Aug 29th, 2010, 10:46 PM
#9
Member
Re: Web form filler help
can you get cookies of this page? with winsock
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
|