VB.net Geckofx如何从Anchor文本获取链接

时间:2015-12-13 15:23:26

标签: vb.net geckofx

我想获得href值" /contact.php"

<a href="/contact.php">Contact</a>

For Each a In wb.Document.GetElementsByTagName("a")
        If a.InnerHtml = "Contact" Then
           'getting the href value
        End If
    Next

1 个答案:

答案 0 :(得分:2)

尝试使用

Dim value As String = a.GetAttribute("href");