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 6074643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:24:19+00:00 2026-05-23T10:24:19+00:00

I use jsoup-1.6.0,parse html tag string, that only include string content 0, but jsoup

  • 0

I use jsoup-1.6.0,parse html tag string, that only include string content “0”, but jsoup return null, I understand…

examply:

String html = "<span>0</span>";
Document doc = Jsoup.parse(html);
Elements eles = doc.getElementsByTag("span");
Element span = eles.get(0);
System.out.println(span.hasText());//false
System.out.println(span.ownText());//null, but I hope the result is "0"

It’s why?


Answer:

It should be a bug, binary_runner says jsoup-1.3.3 works well, I test jsoup-1.5.2 works well too. so, I decide use jsoup-1.5.2 .

Thanks binary_runner!

  • 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-23T10:24:19+00:00Added an answer on May 23, 2026 at 10:24 am

    This is a bug in jsoup 1.6.0 caused by an incorrect null check in the new HTML parser implementation.

    I have fixed the issue and it will be available in 1.6.1, which I’ll in the next couple of days.

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

Sidebar

Related Questions

I am currently using Jsoup to parse HTML document and I use the following
I have a user-submitted string that contains HTML content such as <p></p><div></div><p>Hello<br/>world</p><p></p> I would
I'm using Java and Jsoup to parse HTML pages and I want to get
I want to use jsoup just to parse the middle text telling you about
I'm attempting to use jsoup to sanitize the the html posted from a wysiwyg
use this website a lot but first time posting. My program creates a number
We use a data acquisition card to take readings from a device that increases
I understand that jsonp is a technique to get around the same origin policy.
I have a HTML code which looks like this. <html><head><meta http-equiv=refresh content=0;url=http://www.abc.com/event/></head></html> I want
I want to make an application that will grab the HTML from a website

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.