Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another way to get to the DOM, especially if you are using tidy to clean-up your HTML is tidy itself http://php.net/manual/en/book.tidy.php It is not very hard to get elements using tidy, but you need to write your own functions. However, is almost bullet-proof as it can correct for malformed HTML which some of the other libaries don't.


I'm using Tidy now, and it's been working pretty well. What I do is use Tidy to convert mal-formed HTML to XHTML and then use the Simple XML methods for my parsing.

Anyone know if this new library is better than that approach?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: