1 Replies - 473 Views - Last Post: 26 August 2013 - 04:58 AM Rate Topic: -----

#1 VineMie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-August 13

How press button in Web Browser ?

Posted 26 August 2013 - 12:17 AM

i use this
WebBrowser1.document.GetElementById("").InvokeMember("click")

but this button haven't id

Posted Image

and I tried this

Dim allelements As HtmlElementCollection = Bvb.WebBrowser1.document.All

        For Each webpas As HtmlElement In allelements

            'downloadbtn



            If webpas.InnerText("type") = "submit" Then

                webpas.InvokeMember("click")

            End If

        Next

This post has been edited by Atli: 26 August 2013 - 02:39 AM
Reason for edit:: Use [code] tags when posting code.


Is This A Good Question/Topic? 0
  • +

Replies To: How press button in Web Browser ?

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3467
  • View blog
  • Posts: 11,768
  • Joined: 12-December 12

Re: How press button in Web Browser ?

Posted 26 August 2013 - 04:58 AM

If the containing form has an id then get a reference to this form and use

frmReference.InvokeMember("submit")

If it doesn't have an id for some reason then you might loop through the document.Forms collection to find it.

InnerText is not working because "submit" is not the input's inner-text but its value-attribute's text. There are ways to check for this as well, but submitting the form should be simpler.

This post has been edited by andrewsw: 26 August 2013 - 05:01 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1