Results 1 to 9 of 9

Thread: Web form filler help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    120

    Post 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

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    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:
    1. Private Sub Form_Load()
    2.     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="
    3.    
    4. End Sub
    5.  
    6. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    7.     If (pDisp Is WebBrowser1.Application) Then
    8.         WebBrowser1.Document.All.Item(".fn").Value = "First Name"
    9.         WebBrowser1.Document.All.Item(".ln").Value = "Last Name"
    10.         WebBrowser1.Document.All.Item(".intl").Value = "uk"
    11.         WebBrowser1.Document.All.Item(".sx").Value = "m"
    12.         WebBrowser1.Document.All.Item("login").Value = "LOGIN NAME"
    13.         WebBrowser1.Document.All.Item(".pw").Value = "Password"
    14.         WebBrowser1.Document.All.Item(".pw2").Value = "Password"
    15.        
    16.     End If
    17. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    120

    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:
    1. WebBrowser1.Document.All.Item("pwq").Value = "What is your fathers middle name?"
    Last edited by ally01; Jul 18th, 2006 at 04:17 PM.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    120

    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:
    1. WebBrowser1.Document.All.Item(".job").Value = "Analyst"
    also
    VB Code:
    1. 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:
    1. 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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    120

    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..

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    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:
    1. 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
    2.  
    3. Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    4.     Dim lngRetVal As Long
    5.     lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    6.     If lngRetVal = 0 Then DownloadFile = True
    7. End Function

    code to fill out the rest (You need a reference to the HTML Object library)
    VB Code:
    1. WebBrowser1.Document.All.Item(".ind").Value = "21"
    2.         WebBrowser1.Document.All.Item(".ind").onchange
    3.         WebBrowser1.Document.All.Item(".job").Value = "34"
    4.         WebBrowser1.Document.All.Item(".job").onchange
    5.         WebBrowser1.Document.All.Item(".spe").Value = "10"
    6.  
    7.        
    8.         Dim HTML As HTMLDocument
    9.         Dim IMG As HTMLImg
    10.         Set HTML = WebBrowser1.Document
    11.         For Each IMG In HTML.images
    12.             If IMG.alt = "Registration Verification Code" Then
    13.                 IMG.src = "http://ab.login.yahoo.com/img/R62hJeVZFenctOY3wTLxw1uvrmIVjvgq098E4svT8EiavO8hwl42Qzn5xAmmXFZMyTwWHBlrKO_a.jpg"
    14.                 DownloadFile IMG.src, "C:\tmp.jpg"
    15.                 If Len(Dir("C:\tmp.jpg")) <> 0 Then
    16.                     Picture1.Picture = LoadPicture("c:\tmp.jpg")
    17.                     Exit For
    18.                 End If
    19.             End If
    20.         Next
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    120

    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:
    1. 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.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    120

    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:
    1. Option Explicit
    2. 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
    3.  
    4.  
    5. Private Sub Command1_Click()
    6.  With Socket
    7.     .Close
    8.      '.Connect "216.109.127.6", 80
    9.      .Connect "edit.my.yahoo.com", 80
    10.   End With
    11. End Sub
    12.  
    13. Private Sub Socket_Connect()
    14. 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
    15. End Sub
    16.  
    17. Private Sub Socket_DataArrival(ByVal bytesTotal As Long)
    18. Dim Data As String
    19. Dim TargetLink As String
    20. Dim TargetLink1 As String
    21. Dim a As Integer
    22. Dim b As Integer
    23. Dim c As Integer
    24. Dim SecData As String
    25.   If (Socket.State = sckConnected) Then
    26.      Socket.GetData Data, vbString, bytesTotal
    27.      If (InStr(1, Data, "url: ", vbTextCompare) <> 0) Then
    28.         TargetLink = Mid$(Data, InStr(1, Data, "url: ") + 5, InStr(1, Data, Chr$(&HA) & "secdata:") - 7)
    29.         SecData = Mid$(Data, InStr(1, Data, "secdata: ") + 9, Len(Data) - 2)
    30.         a = Len(TargetLink)
    31.         b = Len(SecData)
    32.         c = a - b - 10
    33.         TargetLink1 = Left$(TargetLink, c)
    34.         Call URLDownloadToFile(0, TargetLink1, App.Path & "\Image.jpg", 0, 0)
    35.         Image1.Picture = LoadPicture(App.Path & "\Image.jpg")
    36.         Text1 = TargetLink1
    37.      End If
    38.   End If
    39. End Sub
    40.  
    41. 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)
    42. MsgBox Description, vbOKOnly, "yep...its an error alright"
    43. 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.

  9. #9
    Member
    Join Date
    Jun 2010
    Posts
    56

    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
  •  



Click Here to Expand Forum to Full Width