How to invoke Click using HTML AGILITY PACK

≡放荡痞女 提交于 2019-12-12 12:18:02

问题


In WebBrowser( WEBFORMS) we can i InvokeMember("click") when we parse an HTML. How can we do this using HTML AGILITY PACK .

<a id="ctl0_CONTENU_PAGE_resultSearch_PagerTop_ctl2" href="javascript:;//ctl0_CONTENU_PAGE_resultSearch_PagerTop_ctl2">

How can i use HTTP REQUEST when we have a javascript in Href.


回答1:


No htmlagiliypack is not a html rendering engine you cannot invoke a click event . It 's just a parsing tool
use Webbrowser or selenium webdriver if you want




回答2:


HtmlAgilityPack is only used to parse HTML and it doesn't support invoking events.

To invoke events you could use WebClient to send HTTP Request or Selenium.

For Selenium you could check this answer here: https://stackoverflow.com/a/34244583/7827699

For How to send Http Requests using WebClient: https://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.110).aspx



来源:https://stackoverflow.com/questions/43659356/how-to-invoke-click-using-html-agility-pack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!