php lib,用于将html解析为DOM层次树 [英] php lib for parsing html to DOM hierarchy tree
本文介绍了php lib,用于将html解析为DOM层次树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一些php库来将html内容解析为DOM树像这样:
I need some php library to parse html content to DOM tree Like this:
html
|--head
| |---title--title_content
| |---meta--meta_content
|--body
| |---div
| | |--div--div_content
..等等
并重新替换或清除无效的html.
and also repare or clean the invalid html.
ITS不仅适用于任何XML样式标记语言的HTML BUT事件.基本上是亲子风格.
ITS not only for HTML BUT event for any XML style mark-up language. basically a parent-child style.
推荐答案
简单HTML DOM 可以很好地与HTML,甚至是无效的HTML,但我不确定它如何处理XML.如果您正在寻找XML操作,则php文档中有一个库列表.
Simple HTML DOM works great with HTML, even invalid HTML, but I am not sure how it handles XML. If you are looking for XML manipulation, the php documentation has a list of libraries.
这篇关于php lib,用于将html解析为DOM层次树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文