Dim web As System.Windows.Forms.WebBrowser = e.form.controls("webbrowser1").Basecontrol
Do Until web.ReadyState = 4
Application.DoEvents
Loop
Dim elems As object = web.Document.GetElementsByTagName("div")
Dim a1 As String
Dim a2 As String
Dim a3 As String
Dim a4 As String
Dim a5 As String
Dim a6 As String
Dim a7 As String
Dim a8 As String
Dim a9 As String
Dim a10 As String
For Each elem As object In elems
If elem.getattribute("classname") = "cell" Then
a1=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a2=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a3=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a4=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a5=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a6=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a7=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a8=elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a9 =elem.innerText
End If
If elem.getattribute("classname") = "cell" Then
a10=elem.innerText
End If
Dim dr As Row = Tables("表A").AddNew()
dr("第一列")=a1
dr("第二列")=a2
dr("第三列")=a3
dr("第四列")=a4
dr("第六列")=a6
dr("第五列")=a5
dr("第七列")=a7
dr("第八列")=a8
dr("第九列")=a9
dr("第十列")=a10
Next
我这样写的,但是不行,变成了一行都是一样的