WebBrowser control HTMLDocument automate selecting option drop-down

后端 未结 7 2068
-上瘾入骨i
-上瘾入骨i 2021-02-02 00:28

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:08

    Assuming you have the following select in the HTML:

    
    

    This should allow you to preselect the third value:

    webBrowser1.Document.GetElementById("term_id").SetAttribute("value", "201010");
    

提交回复
热议问题