Results 1 to 2 of 2

Thread: Get Data from HTML File ?

  1. #1

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Get Data from HTML File ?

    Hello,

    i want to extract data from html file, and than save to SQL Database use vb6
    this my data in html file:

    data.html
    Code:
    <html>
    ....
    <table>
    <tr><td>Product Name</td><td>Price</td><td>Qty.Sales</td></tr>
    <tr>
    <td>Shoes</td><td>200</td><td>5</td>
    </tr>
    <tr>
    <td>Windows XP</td><td>300</td><td>4</td>
    </tr>
    </table>
    ....
    </html>
    and i want to get data, like this:

    Code:
    product name	price	qty.sales
    ---------------------------------
    Shoes		200	5
    Windows XP	300	4

    anyone know how to do this ?

    thank you

  2. #2

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Re: Get Data from HTML File ?

    ok solved, i used:
    vb Code:
    1. i = 0
    2.     itable = 0
    3.     sfile = "d:/data.html"
    4.     Open sfile For Input As #intD
    5.         Do Until EOF(intD)
    6.             Input #intD, strTemp
    7.            
    8.             If InStr(1, strTemp, "<!--") Then GoTo skip
    9.            
    10.             If InStr(1, strTemp, "<table>") Then
    11.                 itable = itable + 1
    12.             End If

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