0

我需要点击“Anmelden”进入下一页。 在此处输入图像描述

这些元素在 html 代码中描述为:

<nav id="main-menu" role="navigation">

          <a href="https://csp.stocko-contact.com/portal/">Startseite</a>
          <a href="https://csp.stocko-contact.com/portal/authenticate.php">Anmelden</a>  </nav>

在我的 VBA 代码中,我尝试使用代码选择此链接:

Option Explicit
Dim IE As InternetExplorer
Dim l As Object
Dim link As HTMLAnchorElement

(...)

For Each l In IE.Document.getElementsByTagName("a")
    If l.href = "https://csp.stocko-contact.com/portal/authenticate.php" Then
    l.Click
    End If
Exit For
Next

我使用 IE8。有什么建议吗?提前致谢。

4

0 回答 0