Java的HTML DOM解析器 [英] HTML DOM parser for Java
本文介绍了Java的HTML DOM解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我想阅读一个网页并访问其DOM树进行处理.在基于Android的设备上是否有建议的方法?我需要从表中提取一些字段,并且我不想自己解析HTML,因为它的格式不正确.
页面本身永远对用户不可见,我只是对解析器感兴趣.当然,肯定有一些人使用过.
Java库并不是我真正的领域,因此可以提出任何建议.
提前谢谢.
/Niklas
Hi
I want to read a web page and access its DOM tree for processing. Is there any suggested way of doing this on an android based device? I need to extract a few fields from a table, and I don''t want to parse the HTML myself since it''s not well-formed.
The page itself should never be visible to the user, I''m just interested in the parser. Surely there must be a few which some of you have used.
Java libraries isn''t really my field so any suggestion is appreciated.
Thanks in advance.
/Niklas
推荐答案
以下是Java HTML解析器库的一个很好的集合 ^ ].
我会选择 Java Mozilla HTML解析器 [ ^ ]或 HotSax [
Here is a sweet collection of Java HTML parser libraries http://java-source.net/open-source/html-parsers[^].
I''d go with Java Mozilla Html Parser[^] or HotSax[^] depending on the exact requirements.
Cheers!
—MRB
这篇关于Java的HTML DOM解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文