Analysis of php plug-in SimpleHTMLDOM using DOM to process HTML. The simple_html_dom plug-in uses dom to process html files. the code for loading the simple_html_dom.php file copy code is as follows: require_oncesimple_html_dom.phpnewsimple_html_dom object simple_html_dom plug-in
A powerful tool for processing html files with dom
Usage:
Load the simple_html_dom.php file
The code is as follows:
Require_once 'simple _ html_dom.php'
New simple_html_dom object
The code is as follows:
$ Dom = new simple_html_dom ()
Load html
The code is as follows:
$ Dom-> load ($ html );
Find () method
The code is as follows:
$ Dom-> find ('P. lookleftname', 0)-> plaintext
Class = plain text in p of 'lookleftname'
The code is as follows:
$ Dom-> find ('P. lookleftname', 0)-> innertext
Class = internal text in p of 'lookleftname'
Commonly used plaintext and innertext
The following code loads the simple_html_dom.php File: require_once 'simple _ html_dom.php 'new simple_html_dom object...