Parse HTML And Traverse DOM In PHP?

I love how easily I can traverse an HTML document with jQuery, and I’d love to be able to do it in PHP. There are a few classes, but the PHP binding for Tidy seems to be where it’s at. The Zend dev pages make it look that way, anyway.

3 Comments

  1. Pingback by » Parse HTML And Traverse DOM In PHP? on March 4, 2008 8:22 pm

    [...] MaisonBisson.com A bunch of stuff I would have emailed you about.   « Parse HTML And Traverse DOM In PHP? [...]

  2. Comment by Rude on March 6, 2008 10:07 am

    Surely a nice way to cope with not strictly valid HTML Code. But: how would you do the traversing? Tidy does not offer very comfortable functions for navigating inside an HTMLs DOM.

    An example: jQuery offers possibilities such as “find all elements of class xy and change their first child’s background colour to yellow”. How could anything like this be performed in PHP?

    Cheers, Rude

  3. Comment by PHPer on March 16, 2008 6:00 pm

    Try
    “PHP Simple HTML DOM Parser”
    at
    http://sourceforge.net/projects/simplehtmldom/

Comments RSS TrackBack Identifier URI

Leave a comment

 

User contributed tags for this post:

1