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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:38:17+00:00 2026-06-01T01:38:17+00:00

I ve looked at the JSoup Selector Overview documentation but I’m still having problems.

  • 0

I ve looked at the JSoup Selector Overview documentation but I’m still having problems. I want to get information from a webpage and this information is stored in a table. Once I retrieve this I want to split into the individual rows in order to use it later; but I can’t seem to do it.

I have JSoup running fine but it doesn’t work when I try to reference the particular table I want by Id such as:

try 
                {
                    Document doc = Jsoup.connect( myHtml ).get();

                    Elements pTag = doc.select( "table#ctl00_ContentPlaceHolder1_tblPasses" );
                    //Elements links = doc.select( "a[href]" );
                    String pTagString = pTag.html();

                    // Set the textview to the results of the Jsoup query
                    setData( pTagString );

                    // Reset msg
                    msg = null;
                    msg = handler.obtainMessage( UPDATE_UI );
                    handler.sendMessage( msg );

                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

Here is the segment of HTML code Im attempting to get to:

<table id="ctl00_ContentPlaceHolder1_tblPasses" class="standardTable" cellspacing="0" cellpadding="4" rules="cols" border="2" style="background-color:White;border-color:Gray;border-width:2px;border-style:Solid;border-collapse:collapse;">
<tr class="tablehead" style="border-width:0px;border-style:None;">
    <td valign="middle" rowspan="2">Date</td><td id="ctl00_ContentPlaceHolder1_MagHeader" valign="middle">Brightness</td><td align="center" colspan="3">Start</td><td align="center" colspan="3">Highest point</td><td align="center" colspan="3">End</td>
</tr><tr class="tablehead">
    <td id="ctl00_ContentPlaceHolder1_MagHeader2" align="center">(<a id="ctl00_ContentPlaceHolder1_linkMagnitude" title="show definition of this term" href="glossary.aspx?term=magnitude&amp;lat=54.5156&amp;lng=-6.06863&amp;loc=Unspecified&amp;alt=0&amp;tz=GMT">mag</a>)</td><td align="center">Time</td><td><a id="ctl00_ContentPlaceHolder1_linkAltitude" title="show definition of this term" href="glossary.aspx?term=altitude&amp;lat=54.5156&amp;lng=-6.06863&amp;loc=Unspecified&amp;alt=0&amp;tz=GMT">Alt.</a></td><td><a id="ctl00_ContentPlaceHolder1_linkAzimuth" title="show definition of this term" href="glossary.aspx?term=azimuth&amp;lat=54.5156&amp;lng=-6.06863&amp;loc=Unspecified&amp;alt=0&amp;tz=GMT">Az.</a></td><td align="center">Time</td><td>Alt.</td><td>Az.</td><td align="center">Time</td><td>Alt.</td><td>Az.</td>

This is only part of the table, there’s a lot more but for now I want to get at this table and it’s first row. Any thoughts?

Update

I tried this:

Elements table = doc.select( "table#ctl00_ContentPlaceHolder1_tblPasses" );
Element first_Row = table.first();

//Elements links = doc.select( "a[href]" );
String first_Row_Strg = first_Row.html().toString();

// Set the textview to the results of the Jsoup query
setData( first_Row_Strg );

But it actually returns the whole table and not the first row. Should I try aiming at the actual identifier of the row in the table? If so how do you do it?

  • 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-06-01T01:38:18+00:00Added an answer on June 1, 2026 at 1:38 am

    think differently, select directly child from parent.

    Element first_row = doc.select("table#ctl00_ContentPlaceHolder1_tblPasses tr").first();

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

Sidebar

Related Questions

I looked at individual layouts and views (here) , but I still cannot decide
Looked through the documentation in the .NET reference but it didn't say. List<TransactionInfo> currentIdsForValuation
Looked at a tutorial but couldn't get this working: default.aspx: <%@ Page Language=C# ContentType=text/xml
Have looked quite hard for this answer but having no luck. I have 3
I looked at SQL Server dateformat codes but I couldn't find dd.mm.yyyy hh:mm format
I looked up in the net, but cannot find any answer (maybe my search
I looked through previous questions to this effect, but my situation is slightly different...
Ive looked for some examples online but i couldn't fund any. how can i
looked around here, but didn't find straightforward answer.. I'm using cookies, to store last
Looked for an answer for this question, but I haven't found a suitable one

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.