PHP Simple HTML DOM Parser does not handle invalid HTML - got stuck within a first trial
I am trying to select either a class or an id using PHP Simple HTML DOM Parser with absolutely no luck.
My example is very simple and seems to comply to the examples given in the manual
(simplehtmldom.sourceforge AT net/manual.htm) but it just wont work, it's driving me up the wall. Other example scripts given with simple dom work fine.See the example: link text This is the easiest example i have found ... How to parse it?
Should i do it with Perl - The example HTML page is invalid HTML.
I开发者_高级运维 do not know if theSimple HTML DOM Parser
is able to handle badly malformed HTML
(probably not).
Well: if i cannot get it to run i can try out some Perl parsers eg HTML::TreeBuilder::XPath
Use Tidy to clean up the malformed HTML before parsing it using the PHP DOM parser.
http://www.php.net/manual/en/tidy.examples.basic.php
精彩评论