Perform a click on a Webbrowser control

后端 未结 3 995
挽巷
挽巷 2021-01-16 11:43

Does anybody know a good way to perform a click on a control inside of a webbrowser? Preferably from ID?

Thanks, ALL suggestions are appreciated.

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-16 12:36

    This isn't really for an ID but you can do the same thing with it by using the value button.

    Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
    
    For Each webpageelement As HtmlElement In allelements
    
    If webpageelement.GetAttribute("value") = "Log In" Then
    
    webpageelement.InvokeMember("click")
    
    End If
    
    Next
    

提交回复
热议问题