Extract Data from HTML source

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!
 
F

Flinky Wisty Pomm

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top