Here is the code I am playing around
I am getting error populating the table cells into my listview. In my codes it is always add only in one cloumn in my lv.
Here is my ListView layout
I am getting error populating the table cells into my listview. In my codes it is always add only in one cloumn in my lv.
VB.NET:
Private Sub DumpTables()
Dim t, c As Integer ' Used to count tables and cells.
Dim IWebDocument As HTMLDocument
Dim IWebElements As IHTMLElementCollection
Dim ITableElement As HTMLTable
Dim ICellElement As HTMLTableCell
ListBox1.Items.Clear()
'GET DOCUMENT
IWebDocument = CType(wb.Document, HTMLDocument)
'GET TABLES
IWebElements = IWebDocument.getElementsByTagName("TABLE")
'ListBox1.Items.Add("Length = " & IWebElements.length)
' Iterate through all the Tables on the web page.
t = 0
For Each ITableElement In IWebElements
' Iterate through all the cells within a table.
c = 0
For Each ICellElement In ITableElement.cells
ListView1.Items.Add(New ListViewItem(New String() {ICellElement.innerText}))
c = c + 1
Next
t = t + 1
Next
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
wb.Navigate("http://rushcodes.aybydinnovations.com/coderesult.php")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DumpTables()
End Sub
Here is my ListView layout