PHP Simple HTML DOM Parser Script
After uploading the class file, the simple HTML DOM class instance has to be created. There are three ways to create a DOM class:
- Load HTML from a file
- Load HTML from a URL
- Load HTML from a string
If you use “Load HTML from a string” and want more control over HTTP request, then use CURL instead to fetch HTML to a string and after that load the DOM class object from a string.
You can use the find function to find HTML DOM elements on the page. It returns an object or an array of an objects.
Use “selectors” to find DOM Elements:
Parent, child and sibling elements selection using built-in functions: