Results 1 to 40 of 531

Thread: Manipulate/Change/Form Fill data in webpages using the Webbrowser control

Hybrid View

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control

    I am not aware of any easy way to auto fill content within frames.

    I also didn't find anything that looked promising in my searches.

    If I do figure out a way to manipulate content in frames, I will update this example code accordingly

  2. #2
    New Member
    Join Date
    Jul 2006
    Posts
    9

    Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control

    Ok... this should be easy, but I'm having a terrible time...

    kleinma, I've looked over your sample and still can't get this to work:

    All I'm trying to do is fill in the info on the paypal website and log in. The email field is named "login_email", the password field is "login_password", and the submit button is named "submit.x"

    I've scrapped all of my repeated attempts, because I haven't been able to get anything to work.

    I've ended up with this, even though I know it's not exactly how you coded your sample, I ended up straying away because I couldn't get yours to work.

    Code:
            If IsBrowserBusy(WebBrowser1) = False Then
                Dim HTML As HtmlDocument
                Dim HTMLS As mshtml.HTMLInputButtonElement
                HTML = WebBrowser1.Document
                HTML.All.Item("login_email").InnerText = "***"
                HTML.All.Item("login_password").InnerText = "*****"
                HTML.All.Item("submit").Click()
                For Each HTMLS In WebBrowser1.Document.GetElementsByTagName("input")
                    If HTMLS.type = "submit" And HTMLS.value = "Log In" Then
                        HTMLS.click()
                        Exit For
                    End If
                Next
    
    
            End If
    IsBrowserBusy is just a function I made to return whether or not the browser is busy. With this code, the textboxes were filled in, but I can't get it to submit, before even compiling i get this error:

    "Error 1 'Public Event Click(sender As Object, e As System.Windows.Forms.HtmlElementEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event."

    Ugh, this is frustrating! Hopefully you have some time to lend a hand-
    Last edited by coheed; Mar 14th, 2007 at 06:50 AM. Reason: vbcode

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