WebBrowser control HTMLDocument automate selecting option drop-down

后端 未结 7 2052
栀梦
栀梦 2021-02-02 00:33

I\'m trying to automate in a WinForm using a WebBrowser control to navigate and pull report info from a website. You can enter values in textboxes and invoke the click events fo

相关标签:
7条回答
  • 2021-02-02 01:19

    try this:

    add reference to microsoft.mshtml in project --> add reference...

        Dim cboTemp As mshtml.HTMLSelectElement
        cboTemp = WebBrowser1.Document.GetElementById("myselect").DomElement
        cbotemp.selectedindex = 2
    

    having the variable cbotemp set to a select element gives you greater access to the control :)

    0 讨论(0)
提交回复
热议问题