I've heard, that parsing HTML using the Cthulhu way is not very good. But what are the right ways to parse HTML? Or is it possible to parse it at all?
closed as unclear what you're asking by gnat, Pieter B, Bart van Ingen Schenau, World Engineer Apr 15 '14 at 14:11
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Or is it possible to parse it at all?
Some say it's possible, and that even webbrowsers use this feature to display web pages.
what are the right ways to parse HTML?
Basically you need a parser able to express the idea that an html element can be composed of other html elements.
<div> some text <div> nested element!! </div> <!--a regular expression cannot tell if this closes the first or second div--> </div>
This cannot be done with regular expression. But you can do it with more general kinds of parsers.