我测试没有问题:
Dim web As New System.Windows.Forms.WebBrowser()
web.ScriptErrorsSuppressed = True
web.Navigate("http://www.foxtable.com/userlist.htm")
Do Until web.ReadyState = 4
Application.DoEvents
Loop
Dim elems As object = web.Document.GetElementsByTagName("table")
elems = elems(0).GetElementsByTagName("tr")
可以判断一下:
Dim web As New System.Windows.Forms.WebBrowser()
web.ScriptErrorsSuppressed = True
web.Navigate("http://www.foxtable.com/")
Do Until web.ReadyState = 4
Application.DoEvents
Loop
Dim elems As object = web.Document.GetElementsByTagName("table")
If elems.count = 0 Then
MessageBox.show("没有表")
Else
elems = elems(0).GetElementsByTagName("tr")
End If