in reply to Untemplating

Another name for this type of activity is 'screen scraping'. One approach that matts advocates for screen scraping HTML is to use XPath.

The first issue you'll need to address is that your HTML is probably not well-formed XML. Two approaches that spring to mind are:

Then you can 'zero in' on a part of the page using an XPath expression like this:

/html/body/table/tr/td[./b]

which would match all td 'nodes' which contain a 'b' tag and occur in a 'tr' in a 'table' in the 'body' of the 'html' document. Once you have selected nodes in this way, you can use XPath to dissect them further, or dump them back out to an XML string (including all child nodes) and do regex matches against that.

See also, the XPath tutorial at zvon.org