 <p>There are no C++ libraries for what you're trying to do (unless you're going to link with a half of Mozilla or WebKit), but you can consider using Java with <a href="http://htmlunit.sourceforge.net/" rel="nofollow">HTMLUnit</a>.</p> <p>And for those suggesting regular expressions, an obligatory <a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454">reference</a>. </p>