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

  • SEARCH
  • Home
  • 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 7641159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:51:13+00:00 2026-05-31T08:51:13+00:00

I am working on Android application that parses a website but I can’t seem

  • 0

I am working on Android application that parses a website but I can’t seem to get Jsoup to work.

I am trying to parse this html:

Here’s a pic

My code just now is:

Document doc = null;
      try{
     doc = Jsoup.connect("URL").get();
      Elements tds = doc.select("table.tr>td");

     for (Element td : tds) {
       String tdText = td.text();
       System.out.println(tdText);
     }
    } 

At the moment it does not return anything but if I print ‘doc’ it return the whole website.

I am trying to extract the following information:
Drower, E. S. (Ethel Stefana), Lady, b. 1879, With or without the &nbsp.

But I can’t seam to get it to work.

Thanks for your help!

  • 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-31T08:51:14+00:00Added an answer on May 31, 2026 at 8:51 am

    You got the selector wrong: it picks td children of a table element with class tr, while you probably want td cells in tr rows in a table. I believe you could get at them just by using "td" as selector.

    However, that’s a bit too generic, since it’s going to pick every cell in the table. If the cell you need is always the third cell in the rows of that table, you can refine the selector to pick only those: "td:eq(2)". You should really get a knack of JSoup selectors, and experiment a little bit to see how much you are able to restrict the data extracted from the document to just the elements you really need.

    To obtain the text after the <script> element in the fourth cell you could use something along the following snippet:

    Element td = doc.select("td:eq(3)").first();
    System.out.println(td.text());
    

    because, from a little experiment of mine, it seems that JavaScript code inside <script> tags is skipped when asking the text of an element that contains one of those.

    You would use a for loop rather than first, though, since there are as many fourth cells as there are rows in your document, and you got a lot of them.

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

Sidebar

Related Questions

I am working on an Android application that parses one or more XML feeds
I'm working on a client-server Android application and trying to figure out how to
We're working on an Android application that shows information about parkings on a map.
I am working on an android application that requires multiple views which will overlap
I'm working on an Android application that has several Activities. In it I have
I'm working on an Android application that needs to download an image and display
I am working on an Android application that is required to connect to a
I'm new to Android development and working on an Android application that requires the
I have an Android application that I've been working on, and it's implemented using
I'm currently working on an android application that uses a subclass of SimpleListAdapter to

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.