There are lots of XML and HTML parsers in Python and I am looking for a simple way to extract a section of a HTML document, preferably using an XPATH construct but that's only optional.
Here is an example
src = "<html><body>...<div id=content>AAA<B>BBB</B>CCC</div>...</body></html>"
I want to extract the entire body of the element with id=content, so the result should be: <div id=content>AAA<B>BBB</B>CCC</div>
It would be if I can do this without installing a new library.
I would also prefer to get the original content of the desired element (not reformatted).
Usage of regexp is not allowed, as these are not safe for parsing XML/HTML.