Categories
PHP

PHP DOM and XPATH

After checking out beautifulsoup in Python, I became very curious to know what we have in PHP for accessing the DOM nodes of a html document. After exploring a while, I found out the PHP DOM and XPATH.

Here’s a little example:

masnun.html – The HTML file

Now we use PHP to access the document:

That’s it, pretty simple and easy ! 😀