Results 1 to 6 of 6

Thread: [RESOLVED] Parsing and getting Data from webbrowser TABLE

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    Resolved [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..
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    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:
    1. Private Sub DumpTables()
    2.  
    3.  
    4.         Dim t, c As Integer  ' Used to count tables and cells.
    5.  
    6.         Dim IWebDocument As HTMLDocument
    7.         Dim IWebElements As IHTMLElementCollection
    8.         Dim ITableElement As HTMLTable
    9.         Dim ICellElement As HTMLTableCell
    10.  
    11.         ListBox1.Items.Clear()
    12.  
    13.         'GET DOCUMENT
    14.         IWebDocument = CType(wb.Document, HTMLDocument)
    15.  
    16.         'GET TABLES
    17.         IWebElements = IWebDocument.getElementsByTagName("TABLE")
    18.         'ListBox1.Items.Add("Length = " & IWebElements.length)
    19.  
    20.         ' Iterate through all the Tables on the web page.
    21.         t = 0
    22.         For Each ITableElement In IWebElements
    23.  
    24.             ' Iterate through all the cells within a table.
    25.             c = 0
    26.             For Each ICellElement In ITableElement.cells
    27.                 ListBox1.Items.Add("|--" & ICellElement.innerText & "--|")
    28.                 ListView1.Items.Add(ICellElement.innerText)
    29.                 c = c + 1
    30.             Next
    31.             t = t + 1
    32.         Next
    33.     End Sub
    34.  
    35.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    36.         wb.Navigate("http://rushcodes.aybydinnovations.com/coderesult.php")
    37.     End Sub
    38.  
    39.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    40.         DumpTables()
    41.     End Sub

    Here is my ListView layout
    Last edited by dr_aybyd; Nov 6th, 2009 at 09:53 AM.
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    Re: Parsing and getting Data from webbrowser TABLE

    BUmp for my thread..I still can't figure it out using listview.
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    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}))
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    310

    Re: Parsing and getting Data from webbrowser TABLE

    Can anyone suggest any help there?
    VB 6.0 = "Self-Study" Then
    vb.NET = "Self-Study" Then
    C# = 'on going study.....

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    167

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width