Extract Data from HTML source

  • Thread starter Thread starter Leon
  • Start date Start date
L

Leon

Please help, I'm trying to grab some data from some html source. I'm using
VB.NET (2003).

Below is a snippet of the html source:
<div class="Individualdetails" id="Individual">Mark Long</p><p>
8823 Big Mark Drive<br/>Showtown, AL 12345</p><p>Phone: (205)
555-5000<br/>Fax: (205)
555-5555</p></div>

The following is the results i need in a table:
Name: Mark Long
Address: 8823 Big Mark Drive
City: Showtown
State: AL
ZipCode: 12345
Phone: 205-555-5000
Fax: 205-555-5555

Basically i'm having trouble building the regular expression needed to pull
this data and
i'm looking for guidance in the right direction. Any help would be greatly
appreciated!
 
A Regex isn't necessarily the best solution here. If you have a
guarantee that your document will be XHTML compliant (and your <br />
will always be an empty, closed tag) you could load it up into an
XmlReader and step through the nodes. That's one way.

There's an HTML munging library out there that was mentioned in a post
the other day. I'll see if I can dig the link back out because that
looked quite slick. I think a regex here is probably not the optimal
solution, though it's possible.
 
Back
Top