Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7581859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:17:50+00:00 2026-05-30T18:17:50+00:00

I am trying to clean HTML text and to extract plain text from it

  • 0

I am trying to clean HTML text and to extract plain text from it using Jsoup. The HTML might contain non-english character.

For example the HTML text is:

String html = "<p>Á <a href='http://example.com/'><b>example</b></a> link.</p>";

Now if I use Jsoup#parse(String html):

String text = Jsoup.parse(html).text();

It is printing:

Á example link.

And if I clean the text using Jsoup#clean(String bodyHtml, Whitelist whitelist):

String text = Jsoup.clean(html, Whitelist.none());

It is printing:

&Aacute; example link.

My question is, how can I get the text

Á example link.

using Whitelist and clean() method? I want to use Whitelist since I might be needed to use Whitelist#addTags(String... tags).

Any information will be very helpful to me.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:17:51+00:00Added an answer on May 30, 2026 at 6:17 pm

    Not possible in current version (1.6.1), jsoup print Á as &Aacute; because the entity escaping feature, there is no “don’t escape” mode now (check Entities.EscapeMode).

    You can 1. unescape these HTML entities, 2. extend jsoup’s source code by adding a new escape mode with an empty map.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I am trying to clean up an HTML file using JTidy, convert it
I'm trying to clean up form input using the following Perl transliteration: sub ValidateInput
I'm trying to clean a Frontpage-generated html file, and there are a ton of
I'm trying to translate an online html page into text. I have a problem
I'm trying to extract all words from a string into an array, but i
I'm trying to display a page of html using bottle (the python web framework).
I'm trying to load an html page from a jsp file. like this. I
I am using Beautiful Soup to extract 'content' from web pages. I know some
I am trying to clean all of the HTML out of a string so
I'm trying to do something similar to: Jsoup: How to get all html between

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.