本文介绍了从java中的html文件中检索文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从java中的html文件中获取文本
I want to get text from html file in java
我的 html
文件是:
<body>
<p>vishal</p>
<strong>patel</strong>
<bold >vishal patel
我想这样输出
vishal
patel
vishal patel
如何做到这一点请帮助我
How to do this please help me
推荐答案
我使用了一个名为的库。
这是非常的从HTML文件中检索纯文本部分很简单。
这很简单:
I have used a library called JSoup.
It's very simple to retrieve the text-only part from a HTML file.
It's very simple:
Jsoup.parse(html).text();
为您提供HTML文件中的文字
gives you the text from the HTML file
这篇关于从java中的html文件中检索文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!