PHP的HTML解析 wiseparser

码农软件 · 软件分类 · HTML解析器 · 2019-04-03 11:43:11

软件介绍

wiseparser 是一个 PHP 语言用来解析 HTML 文档的开发包。

示例代码:

require_once('treebuilder.php');

$mytree = new Tree();<br>
$mytree->parse_content('&lt;div&gt;Hello world&lt;/div&gt;');
// or
$mytree->parse_file('http://www.google.com');
$mytree->parse_file('myfile.htm');

// To print HTML, just do:
echo $mytree;

// For those of you who familiar with HTML::Treebuilder, usage is almost the same. Implemented methods:

 // same as HTML::Element
Element->attr($attr, $value = null);
Element->tag($tag = null);
Element->look_down($keys);
Element->traverse($callback, $text_only=false);
Element->push_content($test_or_node, ..);
Element->unshift_content($test_or_node, ..);
Element->detach();
Element->preinsert($test_or_node, ..);
Element->postinsert($test_or_node, ..);
Element->as_HTML();
Element->as_text();
// plus one additional method:
Element->seek_n_destroy($keys); // same as look_down()->detach()->__destruct();

// same as HTML::Treebuilder:
Tree->parse_content($content);
Tree->parse_file($filename_or_url);

本文地址:https://www.codercto.com/soft/d/2762.html

程序的力量

程序的力量

甄贞 / 法律出版社 / 2002-3 / 21.00元

本书所谈及的话题概括了刑诉法学研究领域的方方面面,既有对每性、广泛性、前瞻性的宏观学科前沿问题的把握;又有实践性、直观性、详细性的个案分析和具体程序操作问题之探讨等。一起来看看 《程序的力量》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具