Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve text from html file in java

Tags:

java

I want to get text from html file in java

My html file is:

<body>

<p>vishal</p>
<strong>patel</strong>
<bold >vishal patel

I want to output like this

vishal 

patel

vishal patel

How to do this please help me

like image 633
Vishal Android developer Avatar asked Mar 09 '12 09:03

Vishal Android developer


Video Answer


1 Answers

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();

gives you the text from the HTML file

like image 183
Rakesh Avatar answered Oct 08 '22 05:10

Rakesh