simple_html_dom插件
用dom处理html文件的利器
使用:
加载simple_html_dom.php文件
require_once 'simple_html_dom.php'
new simple_html_dom对象
$dom = new simple_html_dom()
加载html
$dom->load($html);
find()方法
$dom->find('div.lookLeftname', 0)->plaintext
class=‘lookLeftname’的div中的纯文本
$dom->find('div.lookLeftname', 0)->innertext
class='lookLeftname’的div中的内部文本
plaintext 与innertext最常用的
本文深入探讨了简单HTML DOM插件的使用方法,包括如何加载插件、处理HTML文件及利用find()方法查找特定元素的文本内容。通过实例演示,帮助开发者掌握高效操作DOM的技巧。
1万+

被折叠的 条评论
为什么被折叠?



