-
1
- #1
It is sometimes useful to be able to parse and navigate (and manipulate) the DOM of a page from within PHP. For example, for scraping or automation applications.
Whilst tools exist in native PHP, I have always found them cumbersome compared to, for example, the jQuery selector and manipulation API.
What I did not know until yesterday was that someone has ported bits of jQuery to php and now we can manipulate the DOM in much the same way as we can with jQuery. I played with this in some apps yesterday and whilst the API is missing the jQuery $().closest() methods (which is the main reason I use jQuery), the PHP API is damn useful nonetheless.
You can find it here. Kudos to the author.
Whilst tools exist in native PHP, I have always found them cumbersome compared to, for example, the jQuery selector and manipulation API.
What I did not know until yesterday was that someone has ported bits of jQuery to php and now we can manipulate the DOM in much the same way as we can with jQuery. I played with this in some apps yesterday and whilst the API is missing the jQuery $().closest() methods (which is the main reason I use jQuery), the PHP API is damn useful nonetheless.
You can find it here. Kudos to the author.