- 授权协议: 未知
- 开发语言: PHP
- 操作系统: 跨平台
- 软件首页: https://github.com/bupt1987/html-parser
- 软件文档: https://github.com/bupt1987/html-parser
- 官方下载: https://github.com/bupt1987/html-parser
软件介绍
php html解析工具,类似与PHP Simple HTML DOM Parser。 由于基于php模块tidy,所以在解析html时的效率比 PHP Simple HTML DOM Parser 快2倍多。 并提供广度优先查询find()和深度优先查询find2() 两种查询方式,可根据自己的情况选择使用。 因为代码实现的问题,在查询全部时深度优先比广度优先快一点。
示例代码:
<?php
$html = '<html>
<head>
<title>test</title>
</head>
<body>
<p class="test_class test_class1">p1</p>
<p class="test_class test_class2">p2</p>
<p class="test_class test_class3">p3</p>
<div id="test1">测试1</div>
</body>
</html>';
$html_dom = new HtmlParserModel();
$html_dom->parseStr($html);
$p_array = $html_dom->find('p.test_class');
$p1 = $html_dom->find('p.test_class1',0);
$div = $html_dom->find('div#test1',0);
foreach ($p_array as $p){
echo $p->getPlainText();
}
echo $div->getPlainText();
echo $p1->getPlainText();
echo $pi->class;
?>
深入体验Java Web开发内幕
张孝祥 / 电子工业出版社 / 2007-12 / 55.00元
《深入体验Java Web开发内幕:高级特性》是《深入体验Java Web开发内幕——核心基础》的姊妹篇,Java Web开发的初学者在阅读《深入体验Java Web开发内幕:高级特性》前,应该先学习《深入体验Java Web开发内幕——核心基础》。《深入体验Java Web开发内幕:高级特性》详细阐述了Java Web应用开发中的各种高级特性——Apache文件上传组件的源码分析及应用和编写原理......一起来看看 《深入体验Java Web开发内幕》 这本书的介绍吧!
