[RESOLVED] Parsing and getting Data from webbrowser TABLE
Is it possible to collect data in this page with table. link here
Is t possible to collect and view the data from tables into a ListView control in winForm?
Instead of viewing page in webbrowser. i just want to use listview.
I found klienma's thread in codebank but i could find a way how to parse table data form the web page.
Thanks for the help..
Re: Parsing and getting Data from webbrowser TABLE
Hi, I am playing around with the codes I found here. Thanks mikeki
But my problem is it is using ListBox, I am trying to use listview.
My problem is data are adding in one column only on my listview.
Here is the code I am playing around
vb Code:
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
ListBox1.Items.Add("|--" & ICellElement.innerText & "--|")
ListView1.Items.Add(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
http://i38.tinypic.com/1z99ut.png
Re: Parsing and getting Data from webbrowser TABLE
BUmp for my thread..I still can't figure it out using listview.
Re: Parsing and getting Data from webbrowser TABLE
I tried this codes but still same result
Code:
ListView1.Items.Add(New ListViewItem(New String() {ICellElement.innerText}))
Re: Parsing and getting Data from webbrowser TABLE
Can anyone suggest any help there?
Re: Parsing and getting Data from webbrowser TABLE
make a sample project and attach it to this tread so i can have a look.
Regards Me