开发者

How can I progmatically click a link in a Winform Web Browser control?

开发者 https://www.devze.com 2023-01-10 05:23 出处:网络
I would like to know how to programatically click a link from with in a Winform Web Browser control. foreach (HtmlElement linkElement in webBrowser.Document.GetElementsByTagName(\"A\"))

I would like to know how to programatically click a link from with in a Winform Web Browser control.

 foreach (HtmlElement linkElement in webBrowser.Document.GetElementsByTagName("A"))
            {
                if(linkElement.InnerText == "Helpful Tips")
                {
                  开发者_如何学C//Click Functionality
                }


You should be able to do this using the InvokeMember method. Something along these lines:

linkElement.InvokeMember("Click")
0

精彩评论

暂无评论...
验证码 换一张
取 消