Dim web As New System.Windows.Forms.WebBrowser()
web.ScriptErrorsSuppressed = True
For Each dr As DataRow In DataTables("表A").Select("","简码")
If dr.IsNull("简码") = False Then
web.Navigate("https://vip.stock.finance.sina.com.cn/corp/go.php/vCI_CorpOtherInfo/stockid/" & dr("简码") & "/menu_num/2.phtml")
Do Until web.ReadyState = 4
Application.DoEvents
Loop
Dim tb1 As object = web.Document.GetElementsByTagName("table")(3)
If tb1.count > 3
MessageBox.Show("出错1")
End If
Dim tb2 As object = web.Document.GetElementsByTagName("table")(4)
If tb2.count > 4
MessageBox.Show("出错2")
End If
Dim wz As Integer = Tables("表A").FindRow(dr)
If wz >= 0 Then
Tables("表A").Position = wz
End If
End If
Next
---------------------------
版本:2020.1.19.19
---------------------------
代码执行出错,错误信息:
System.MissingMemberException: 未找到类型“HtmlElement”的公共成员“count”。
在 Microsoft.VisualBasic.CompilerServices.Symbols.Container.GetMembers(String& MemberName, Boolean ReportErrors)
在 Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
在 Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
在 UserCode.Test()
---------------------------
确定
---------------------------