【问题标题】:Perform click on href link in VB.NET在 VB.NET 中执行单击 href 链接
【发布时间】:2015-09-27 05:38:20
【问题描述】:

如何使用 VB.NET 网络浏览器点击此链接?

<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

【问题讨论】:

    标签: html vb.net webbrowser-control


    【解决方案1】:

    我通过将 webbrowser.navigate 放在不同的计时器上并添加一个间隔来解决它。

    【讨论】:

      猜你喜欢
      • 2016-05-17
      • 2010-12-09
      • 2022-01-13
      • 1970-01-01
      • 1970-01-01
      • 2014-09-27
      • 2012-04-28
      • 2013-08-26
      • 1970-01-01
      相关资源
      最近更新 更多