Possible to parse a HTML document and build a DOM tree(java)

后端 未结 5 708
孤街浪徒
孤街浪徒 2021-01-07 07:54

Is it possible and what tools could be used to parse an html document as a string or from a file and then to construct a DOM tree so that a developer can walk the tree throu

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-07 08:17

    You can take a look at NekoHTML, a Java library that performs a best effort cleaning and tag balancing in your document. It is an easy way to parse a malformed HTML (or a non-valid XML) file.

    It is distributed under the Apache 2.0 license.

提交回复
热议问题