我正在从网页解析到 datagridview,但它只填充在第一行。有人可以帮我一把吗?感谢代码
Dim Data(10) As String
Dim Index As Integer = 0
Dim Output As Boolean = False
For Each ELement As System.Windows.Forms.HtmlElement In WebBrowser1.Document.All
If UCase(ELement.TagName.ToString).Contains("TD") And Output = True Then
Data(Index) = ELement.InnerText
Index += 1
ElseIf UCase(ELement.TagName.ToString).Contains("TR") And Output = True Then
For Each row As DataGridViewRow In DataGridView1.Rows
row.Cells.Item("data").Value = Data(0)
row.Cells.Item("data1").Value = Data(1)
row.Cells.Item("data2").Value = Data(2)
Index = 0
Next
End If
Output = True
Next