2015-09-27 95 views
1

如何使用VB.NET webbrowser执行此链接的单击操作?在VB.NET中执行单击href链接

<li class="r"><a href="/nfx/basic/handle_action/?context_str=%7B%22breadcrumbs%22%3A%5B%5D%2C%22story_location%22%3A%22profile_someone_else%22%2C%22confirm_actions%22%3Afalse%2C%22is_from_feed_tombstone%22%3Afalse%2C%22actions_taken%22%3A%22%22%2C%22reportable_ent_token%22%3A%22100009299563743%22%2C%22is_impostor%22%3A%22%22%7D&amp;is_direct=1&amp;action_key=RESOLVE_PROBLEM&amp;redirect_uri=%2Fprofile.php%3Fid%3D100009299563743&amp;ext=1443590401&amp;hash=AeRKfkCXTvlGpyyP">Denunciar este perfil</a></li> 

我已经试过这样的事情,但没有奏效:

Dim elements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a") 
     For Each pElem As HtmlElement In elements 
      If (pElem.OuterHtml.Contains("profile.php")) Then 
       pElem.InvokeMember("click") 
      End If 
     Next 

回答

0

我通过把在不同的定时器webbrowser.navigate和添加的间隔解决它。