在Java中解析HTML? [英] Parsing HTML in Java?
本文介绍了在Java中解析HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为这些原因解析HTML文件:
- 获取标签之间的内容。例如,在一对para标签之间
- 查找中断标签的发生情况
- 获取标签的属性。例如,要获得COLOR的值FONT COLOR =red>
我需要在Java中执行此操作。我知道Jehrico解析器的基础知识。我该怎么做?
解决方案
没有。可用的Java HTML解析器如下:
I want to parse an HTML file for these reasons:
- To the get the content between tags. For example, between a pair of para tags
- To find the occurrence of break tags
- To get the attributes of a tag. For example, to get the value of COLOR in FONT COLOR="red">
I need to do this in Java. I know the basics of the Jehrico parser. How can I do it?
解决方案
There are no. of Java HTML parsers available like:
You might also want to go through a very comprehensive discussion on pros and cons of using each of these here.
这篇关于在Java中解析HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文