Scraping websites or Web scraping is a method of collecting data off from websites using a program to automate the process. Wikipedia defines it as
"a computer software technique of extracting information from websites." For whatever purpose it may be, the creation of web scraping PHP scripts has been made easier using this PHP class for parsing HTML content. From the
PHP Simple HTML DOM Parser website:
- A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!
- Require PHP 5+.
- Supports invalid HTML.
- Find tags on an HTML page with selectors just like jQuery.
- Extract contents from HTML in a single line.
I have used this class several times already in some of my projects and it does work well. Below are some sample codes: