CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2010
    Posts
    0

    Parsing HTML Help

    Hi,

    I am trying to parse some html in vb.net but i not sure how to do it.

    The html that what i am trying to parse is:

    Code:
    <p>&nbsp;</p><table border="0" cellspacing="1" CellPadding="0" width="100%">
    <tr>
    <td align=left valign=top width="20%"><font size="2" ><b>Account Ref</b></font></td>
    <td valign=top width="80%"><font size="2">LPharmacy</font></td>
    </tr>
    <tr>
    <td><font size="2"><b>Date of booking</b></font>
    </td><td><font size="2">Friday 14 August 2009</font></td>
    </tr>
    <tr>
    <td><font size="2"><b>Time of booking</b></font>
    </td><td><font size="2">17:35 ( 5:35 pm )</font></td>
    </tr>
    <tr>
    <td><font size="2"><b>Booking No.</b></font>
    </td><td><font size="2">51900</font></td>
    </tr>
    <tr>
    <td><font size="2"><b>Vehicle type</b></font>
    </td><td><font size="2">Car</font></td>
    </tr>
    <tr>
    <td><font size="2"><b>Number of vehicles</b></font>
    </td><td><font size="2">1</font></td></tr>
    <tr>
    <td><font size="2"><b>From</b>
    </td><td><font size="2">Base, Whittington Moor</td>
    </tr>
    <tr>
    </tr>
    <tr>
    <td><font size="2"><b>To</b></font>
    </td><td><font size="2">Newbold, Newbold</font></td>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    <td><font size="2"><b>Order number</b></font>
    </td><td><font size="2">140809-52</font></td>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    <td><font size="2"><b>Job price</b></font></td>
    <td><font size="2">£3.10</font></td>
    </tr>
    
    </table>
    The infomation i am trying to parse is in bold.

    Many Thanks

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Parsing HTML Help

    you might have a look at regExp...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Mar 2010
    Posts
    11

    Re: Parsing HTML Help

    If the HTML is well formed you can try parsing it as XML. If it is not, you can look into HTML Agility Pack.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Parsing HTML Help

    There are some great sample programs here.
    Last edited by dglienna; March 3rd, 2010 at 07:12 PM.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

Featured