How do I programmatically inspect a HTML document
HTMLparser is a good HTML parser.
I have used this to parse HTML on one of my projects.
You can write your own filters to parse the HTML for what you want, so the
<br>
tag shouldn't be difficult to parse out
Yo can parse out CSS usin the CssSelectorNodeFilter