Clicking button automatically using HtmlAgilityPack

前端 未结 4 724
梦如初夏
梦如初夏 2020-12-21 06:07

I want to click a button on a web page automatically. I am using HtmlAgilityPack. I can take the button\'s Xpath. But I could not fire the click event of the bu

4条回答
  •  醉酒成梦
    2020-12-21 06:38

    Have a look at the following answer: How to click a link element programmatially with HTMLElement?

    He is creating a HtmlElement object (via xPath or by any other way) and then "invoking" the click event with the code:

    htmlItem.InvokeMember("click");
    

提交回复
热议问题