Page 4 of 13 FirstFirst 1234567 ... LastLast
Results 121 to 160 of 531

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

Hybrid View

  1. #1
    New Member
    Join Date
    Jun 2007
    Posts
    6

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

    Quote Originally Posted by kleinma
    instead of using the form specifically, try Invoking a click on the submit button using its ID of "uploadButton"
    It worked!
    but you know what somewhere in my tests im sure i did that, ive been working with it for 4 hours and its almost 2am, now, how do I get rid of ghosts inside this program, hmmm... lesser errors to go! weeeeeeee

    anyways BIG BIG thanks again,
    knds

  2. #2

    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

    no problem

  3. #3
    New Member
    Join Date
    Jun 2007
    Posts
    2

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

    I'm attempting to
    1) click a single checkbox on the loaded page (which should redirect the page in the process)
    2) click a URL on the next page

    Apparrently the checkbox is beyond my scope because I can't seem to get it to work. There are 5 forms on the page, and the check box is in the 4th (index 3?). Also in that form is a hidden value which is specified before the checkbox name. Here is some code I'm working with:

    Code:
    Public Class frmMain
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim tmpStr As String = "http://localhost/CASE_NUMBER=" & CStr(TextBox1.Text)
            wb.Url = New System.Uri(tmpStr)
        End Sub
    
        Private Function GetCurrentWebDoc() As MSHTML.HTMLDocument
            Try
                Return DirectCast(wb.Document, mshtml.HTMLDocument)
            Catch ex As Exception
                Return Nothing
            End Try
        End Function
    
        Private Function GetCurrentWebForm() As MSHTML.HTMLFormElement
            Try
                If GetCurrentWebDoc.forms.length > 0 Then
                    Return DirectCast(GetCurrentWebDoc.forms.item(3), MSHTML.HTMLFormElement)
                Else
                    Return Nothing
                End If
            Catch ex As Exception
                Return Nothing
            End Try
        End Function
    
        Private Sub ClickCheckBox()
            Dim MyInputElement As MSHTML.HTMLInputElement = DirectCast(GetCurrentWebForm.item("checkBoxName", 3), MSHTML.HTMLInputElement)
            MyInputElement.checked = True
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            ClickCheckBox()
        End Sub
    
    End Class
    Unfortunately I can't really post the HTML I'm working with, but I could cut and past relevant portions if I knew what would help.

    Thanks for any suggestions!

  4. #4

    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

    Is the checkbox actually called "checkBoxName" in the HTML code?

  5. #5
    New Member
    Join Date
    Jun 2007
    Posts
    2

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

    no, but I changed it to protect the innocent... I'll PM you the form code itself.

  6. #6

    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

    it works fine. I PMed you with the code that works.

  7. #7
    New Member
    Join Date
    Jun 2007
    Posts
    6

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

    Hi, me again,

    Can InvokeMember be used to click a dynamic button? If not is there a way around this for my auto login to work?

    html code:
    <a onclick="signInSubmit( document.signInForm.login.value, document.signInForm.password.value, document.signInForm.rememberLogin.checked, 'signInForm_err', document.signInForm.source.value )" class="dynaBtn" title="Sign In"><span>Sign In</span></a>&nbsp;

    Im Using VB on VS2005

    Thanks,
    knds

  8. #8

    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

    if you look at my example project you will see an example of calling javascript that is in the HTML page from VB code. You could use that example to call the signInSubmit javascript function from VB code, passing the given values that it expects. That should do it.

  9. #9
    New Member
    Join Date
    Jun 2007
    Posts
    6

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

    Quote Originally Posted by kleinma
    if you look at my example project you will see an example of calling javascript that is in the HTML page from VB code. You could use that example to call the signInSubmit javascript function from VB code, passing the given values that it expects. That should do it.
    I followed the script on your sample application, would there be reasons why my javascript function wont execute? Nothing is happening, I am now trying to click a link with a js function to turn off a flash part on the site so that I could write on the text box

    vb code:
    GetCurrentWebDoc.parentWindow.execScript("switch_non_flash_uploader()", "javascript")

    html code:
    <p> <a> onclick="switch_non_flash_uploader()" href="#"> Click Here </a> if you are having problem with the uploader


    Thanks
    knds

  10. #10
    New Member
    Join Date
    Jun 2007
    Posts
    6

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

    Quote Originally Posted by knds
    I followed the script on your sample application, would there be reasons why my javascript function wont execute? Nothing is happening, I am now trying to click a link with a js function to turn off a flash part on the site so that I could write on the text box

    vb code:
    GetCurrentWebDoc.parentWindow.execScript("switch_non_flash_uploader()", "javascript")

    html code:
    <p> <a> onclick="switch_non_flash_uploader()" href="#"> Click Here </a> if you are having problem with the uploader


    Thanks
    knds
    Im not sure why my code doesn't fire the jv function but a friend of mine did this:
    wb.Navigate("javascript:switch_non_flash_uploader();")

    it worked... im a newbie on this and I didn't inquired further. well i just wanted to share so others may consider this...

    thanks to kleinma, for your time... on answering my questions...

  11. #11

    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 sure why it would not execute. It would be hard for me to guess without being able to see the actual page you are trying to manipulate. Is it a public URL so I can look at it?

  12. #12
    New Member
    Join Date
    Jun 2007
    Posts
    6

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

    I searched on this thread re: frames, does anyone had a success filling up values on a frame?

    knds

  13. #13
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

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

    Sir guide me
    My Problem I want to open vbforums.com but login using the windows application.

    I just open the your link but how to set the value of user name and the password in that website!!

    I am not getting please guide me

    Thanks!!

  14. #14

    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

    if you are using my sample code, then you could use the GetCurrentWebDoc to get the current webpage document, and then grab whatever form you want by name or by its index in the collection

    Code:
    Dim MyForm As mshtml.HTMLFormElement = DirectCast(GetCurrentWebDoc.forms.item("form name here"), mshtml.HTMLFormElement)

  15. #15

    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

    yes in the getcurrentwebform method in my example code, you will see it is specifically grabbing form at index 0. Just change that 0 to whatever number index you want to grab. You could also change the function to allow you to pass in an integer as a parameter, and use that to indicate which form you actually want to retrieve from the webpage document.

  16. #16

    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

    No problem.

    Check back soon, I will be releasing source for an extended WB control that uses the .NET 2.0 built in webbrowser control instead of the COM based one, but has all the features that the 2 provide.

  17. #17

    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

    when you run into this type of situation, try to figure out what action you are trying to simulate versus the result you want (sometimes the opposite is true). In this case, you want to simulate clicking on an image. It just so happens that the result is submitting the form.

    Try this code to simulate clicking the image, which in turn should fire any code attached to that image.

    Code:
    DirectCast(GetCurrentWebDoc.images.item("ctl00$Main$postComment$postcommentImageButton"), mshtml.HTMLImg).click()
    if that name value doesn't work, try the ID instead ("ctl00_Main_postComment_postcommentImageButton")


    I do hope you are making some sort of "utility", and not anything that could be used maliciously to spam comments all over myspace.

  18. #18
    Junior Member
    Join Date
    Oct 2007
    Posts
    18

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

    Quote Originally Posted by kleinma
    when you run into this type of situation, try to figure out what action you are trying to simulate versus the result you want (sometimes the opposite is true). In this case, you want to simulate clicking on an image. It just so happens that the result is submitting the form.

    Try this code to simulate clicking the image, which in turn should fire any code attached to that image.

    Code:
    DirectCast(GetCurrentWebDoc.images.item("ctl00$Main$postComment$postcommentImageButton"), mshtml.HTMLImg).click()
    if that name value doesn't work, try the ID instead ("ctl00_Main_postComment_postcommentImageButton")

    I do hope you are making some sort of "utility", and not anything that could be used maliciously to spam comments all over myspace.


    What a great resource this thread has been, one of very few on the internet for this subject matter. Specific to this issue, my company now has it's own myspace page and it's my job to work it. %-(

    I'm first seeing if it's feasible to do by generating this temporary test solution. I need to auto-comment anyone who sends us a comment or becomes our friend. Akin to this post, you showed how to click on an image, but I'm trying to fill in a textarea form field with your example. However, I'm running into problems. Here is the text area field data source I'm trying to automate similar to the poster above:

    Code:
    <textarea name="ctl00$cpMain$postComment$commentTextBox" rows="5" cols="40" id="ctl00_cpMain_postComment_commentTextBox" style="width:100%;"></textarea>
    I used your source project to try and autofill the textarea box but it's not working. My test program throws an exception stating "Object reference not set to an instance of an object") It keeps telling me that I need to declare a new object. I've tried both ID & Name of control and here is a sample code I'm trying:

    Code:
    Public Class BuiltInBrowser
    
        Private Sub BuiltInBrowser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            wB.Navigate("http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=8")
    
        End Sub
    
        Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetText.Click
            SetTextareaText(txtMessage.Text)
        End Sub
    
        Private Sub SetTextareaText(ByVal Text As String)
            Try
                DirectCast(GetCurrentWebForm.item("ctl00cpMain$postComment$commentTextBox"), mshtml.HTMLTextAreaElement).value = Text
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
    
        End Sub
    
        Private Function GetCurrentWebDoc() As mshtml.HTMLDocument
            Try
                Return DirectCast(wb.Document, mshtml.HTMLDocument)
            Catch ex As Exception
                Return Nothing
            End Try
        End Function
    
        Private Function GetCurrentWebForm() As mshtml.HTMLFormElement
            Try
                If GetCurrentWebDoc.forms.length > 0 Then
                    Return DirectCast(GetCurrentWebDoc.forms.item(0), mshtml.HTMLFormElement)
                Else
                    Return Nothing
                End If
            Catch ex As Exception
                Return Nothing
            End Try
        End Function
    
       
    End Class

    Any help in this matter would be GREATLY appreciated!

  19. #19
    New Member
    Join Date
    Nov 2007
    Posts
    1

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

    Hi kleinma,
    This site is the best source for web page manipulation using GetCurrentWebDoc. I have been using your code to manipulate few sites. But some how I can't access any links, frame or any type of tag for this (http://www.insidercow.com/) site. I get the counts as "0" for all the tags.
    I am using a similar code like below.
    Dim otr As mshtml.IHTMLElementCollection = GetCurrentWebDoc.getElementsByTagName("table")

    But a web page related to the above web site (http://206.222.29.162/winners.jsp), I do lot of manipulation using your example codes.
    Advance thanks.

  20. #20

    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

    Quote Originally Posted by kumartech
    Hi kleinma,
    This site is the best source for web page manipulation using GetCurrentWebDoc. I have been using your code to manipulate few sites. But some how I can't access any links, frame or any type of tag for this (http://www.insidercow.com/) site. I get the counts as "0" for all the tags.
    I am using a similar code like below.
    Dim otr As mshtml.IHTMLElementCollection = GetCurrentWebDoc.getElementsByTagName("table")

    But a web page related to the above web site (http://206.222.29.162/winners.jsp), I do lot of manipulation using your example codes.
    Advance thanks.
    Kumartech,

    that site is a bit odd, in that it uses a single frame page. So getting the current web doc using the function in my code simply returns the frames page, and not the frame document itself. So you can use this code, to grab the frame, and then grab the document from that frame.

    Code:
            Dim mainFrame As mshtml.HTMLWindow2 = DirectCast(GetCurrentWebDoc.frames.item(0), mshtml.HTMLWindow2)
            Dim CurrentWebDoc As mshtml.HTMLDocument = DirectCast(mainFrame.document, mshtml.HTMLDocument)

  21. #21
    New Member
    Join Date
    Jul 2008
    Posts
    1

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

    Hai,we would like thanks to kleinma that provide sample code to us for make our development more easy.But,we are having some issue about button.We have found most button at html pages that available at internet nowadays.Their don't provide id or name for button.At sample code,it only work for button when have id or name.Please refer following for the html code(submit button).

    <form method="GET" action="http://www.myweb.com/addurl.html">
    <tr><td align=left><font face="helvetica,arial,sans-serif">
    Url to add:<br>
    <input type="text" name="url" size=30 value="http://"><br><br>
    Your email address:<br>
    <input type="text" name="email" size=30 value=""><br>
    <input type="checkbox" name="optin" checked value="1"> Send me the newsletter<br><br>

    <input type="submit" value=" Submit URL ">
    </td></tr>
    </form>
    Please advice.
    Thanks a lot.

  22. #22
    Member
    Join Date
    Feb 2008
    Posts
    50

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

    Quote Originally Posted by gmchun83
    Hai,we would like thanks to kleinma that provide sample code to us for make our development more easy.
    But,we are having some issue about button.We have found most button at html pages that available at internet nowadays.
    Their don't provide id or name for button.
    At sample code,it only work for button when have id or name.Please refer following for the html code(submit button).
    if i understand you correct then you can try this
    Code:
    Dim theWElementCollection2 As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
            For Each curElement As HtmlElement In theWElementCollection
                Dim controlName As String = curElement.GetAttribute("type").ToString
                If controlName = "submit" Then
                    curElement.InvokeMember("click")
                End If
            Next

  23. #23

    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

    Sorry, I misread it as just an image (as in <img> tag) and not an input element of type image.

    For some reason, I can't seem to access the specific element when its type image via the forms item collection. However this code seems to work:

    Code:
            Dim MyImageElement As mshtml.HTMLInputElement = DirectCast(GetCurrentWebDoc.all.item("ctl00_Main_postComment_postcommentImageButton"), mshtml.HTMLInputElement)
            MyImageElement.click()

  24. #24
    New Member
    Join Date
    Jul 2007
    Posts
    2

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

    Quote Originally Posted by kleinma
    Sorry, I misread it as just an image (as in <img> tag) and not an input element of type image.

    For some reason, I can't seem to access the specific element when its type image via the forms item collection. However this code seems to work:
    kleinma, first Id like to say a big thanks for this thread, it has been invaluable to me.

    However, I had a page input button I wanted to click with no ID or Name along with several other input buttons on the page that I didnt want to click. To get round this I identified the button by its .src

    heres the code..

    Code:
                Dim thisObj As Object
                Dim butInput As mshtml.HTMLInputElement
                thisObj = AxWebBrowser1.Document.getElementsByTagName("input")
                For Each butInput In thisObj
                    If butInput.src = "TheNameOfTheImage.gif" Then
                        butInput.click()
                    End If
                Next
    If you or anyone has a better way of doing it Id be interested to know, but this worked for me and maybe it'll help someone else too.

  25. #25

    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

    Yes, until I actually finish up my 1.1+2.0 browser control that will have all the functionality of both

  26. #26
    New Member
    Join Date
    Jun 2007
    Posts
    5

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

    Hi, I am also trying to code using VB6 to pass values from my application and fill the values in the web pages and submit the page. But the web pages are in frames. I am new to all these...

  27. #27
    New Member
    Join Date
    Jun 2007
    Posts
    5

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

    hi kleinma, my office blocked downloading of zip file. Can you email me the sample codes? My email is [email protected]. Thanks.

  28. #28

    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

    VB6 or VB.NET?

  29. #29

    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

    Off the top of my head I can't think of any other way of doing it. It does become a bit trickier when you have to deal with HTML that doesn't provide all the tags that it should (like a name or ID tag).

    So what you are doing is fine.

  30. #30
    Lively Member
    Join Date
    Jan 2007
    Posts
    95

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

    cant we simply click on a form's submit button with the original webbrowser???
    Last edited by extreme.aly; Jul 30th, 2007 at 10:48 AM.

  31. #31

    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

    yes of course you can, but this thread is about automating input and interaction on webpages via VB code.

  32. #32
    Lively Member
    Join Date
    Jan 2007
    Posts
    95

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

    noo.. i mean automatically click on a submit button... because i'm having a problem while using the navigate2 function of axshdocvw...and i'm getting the same error when i use the InvokeMember("click") function of the original webbrowser provided in VB2005 expresss ed. here is the error screenshot:
    Attached Images Attached Images  

  33. #33

    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

    the VB2005 managed webbrowser control and the COM webbrowser control act a bit different.

    If you downloaded my sample application, there is a "submit form" example included.

  34. #34
    Lively Member
    Join Date
    Jan 2007
    Posts
    95

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

    yeah i tried to to make it for my application but it show me the error when i use Navigate2 function...

  35. #35

    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

    Well I am not sure why you are using the navigate2 method...

    usually when you are on a page, and you want to submit it, you just simulate the submit button being clicked. This is what my example code does.

    It sounds like you are trying to do something different.

  36. #36
    Lively Member
    Join Date
    Jan 2007
    Posts
    95

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

    noo...i've no page loaded yet..i'm loading it when the app starts...

    look..i got a webform, which requires some dates and to be submitted...and i want the resulted html code...now i want it to be done multiple time with different dates..like
    for i as integer = 0 to 100
    ' fill the date in the webform
    ' submit the form
    ' get the resulted html
    ' parse the html code
    next

  37. #37

    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

    you can't quite do it in a loop like that, because the webbrowser is event driven. It fires events when it is doing things so you know what state it is in, and you know when you should proceed.

    So to accomplish a repetitive task like that, you would need to do something like the following:

    Lets say you have page1.htm (which is the page that has the fields that need to be filled in), and page2.htm (which is the page the form submits to and has the resulting HTML code you want)

    Code:
    -Navigate to page1.htm
    -When the DocumentCompleted event of the webbrowser fires the page has fully loaded
        check the current URL of the WB control
            if its page1.htm, fill in the values you want and submit form
            if its page2.htm, then page1 was just submitted, so get the resulting HTML code.

  38. #38
    Lively Member
    Join Date
    Jan 2007
    Posts
    95

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

    yeah i have done the same thing in the original browser but i have to click to button each time... the code is something like this:
    Code:
    dim counter as integer = 0
    prv sub form_onload(...)
    webbrowser1.documenttext = mycode
    ' press submit button code should be here
    end sub
    
    prv sub webbrowser1_documentcomplete(...)
    if webbrowser1.documenttitle = submitted_page_title then
      parse(webbrowser1.documenttext)
      if counter <> 101 then
        webbrowser1.documenttext = mycode
        ' press submit button code should be here
      end if
    end if
    end sub
    
    prv sub parse(html as string)
    ' parse html
    counter += 1
    end sub
    i just want the button to be clicked automatically without making a BIG change..i think you understand

  39. #39
    New Member
    Join Date
    Aug 2007
    Posts
    15

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

    Hi kleinma,
    I have been following this post for couple of days. I would like to mention that I have never seen anyone so HELPFUL.. You rock!!

    well, i got a problem in doing the same thing. I am using Vb.net 2005 express edition, wherein i am creating an application, that would send in data to the web form fields and get the results. It's actually a ASP.NET webpage, that calculates based on the values entered in the fields.

    I don't know why Mmhtml code, didn't work for me, so i am working with the web browser control 2.0, with the following code:

    WebBrowser1.Document.All.Item("IDTextBox").InnerText() = "202"
    WebBrowser1.Document.All.Item("PasswordTextBox").InnerText() = "123"
    WebBrowser1.Document.All.Item("SelectButton").InvokeMember("click")

    PROBLEM: after I execute this code, the web browser loops it, making the page to reload, input the variables and again click it.. it forms a vicious circle..

    any suggestions..

  40. #40

    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

    What event did you put that code in?

Page 4 of 13 FirstFirst 1234567 ... LastLast

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