我正在尝试获取锚标记,但我得到运行时错误,这是我的代码
Dim html1 As String = WebControl1.ExecuteJavascriptWithResult("document.getElementsByTagName('html')[0].innerHTML")
Dim doc1 As New HtmlDocument
doc1.LoadHtml(html1)
WaitForPageLoad()
Dim node As HtmlNodeCollection = doc1.DocumentNode.SelectNodes("//a")
WaitForPageLoad()
For Each links As HtmlNode In node
If links.Attributes("href").Value = TextBox2.Text Then
WebControl1.ExecuteJavascriptWithResult("")
Application.DoEvents()
WaitForPageLoad()
End If
Next
我不知道我哪里出错了
答案 0 :(得分:0)