A brief analysis of php plug in Simple HTML DOM using DOM to deal with HTML

  • 2020-07-21 07:00:14
  • OfStack

simple_html_dom plug-in
Use dom to process html files
Use:
Load the simple_ES9en_dom.php file

require_once 'simple_html_dom.php'

new simple_html_dom object

$dom = new simple_html_dom()

Loading html

$dom->load($html);

find () method

$dom->find('div.lookLeftname', 0)->plaintext

class= plain text in div of 'lookLeftname'

$dom->find('div.lookLeftname', 0)->innertext

class= internal text in div of 'lookLeftname'
plaintext and innertext are most commonly used

Related articles: