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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:36:07+00:00 2026-06-16T16:36:07+00:00

I’ve already looked into several Stack Overflow topics with similar questions. I have the

  • 0

I’ve already looked into several Stack Overflow topics with similar questions.

I have the following problem: I have a simple html page, downloaded and saved locally as .html File, I am parsing it with JSoup to read the content of that table. Unfortunately when I look for my table with .select(“table”) it returns me no Elements. Hence I have debugged it, what I could notice is… my body node has one childnode, which appears to be solely String, and thus I assume I can’t find any table node?

Can anyone help me out please?

Here is my code snippet:

   for (Element table : doc.select("table.creditsuisse")) {
        for (Element row : table.select("tr")) {
            for (Element tds : row.select("td")){
                for(Element link : row.select("href")){
                    System.out.println(link.text());
                }
                System.out.println(tds.text());
            }
        }
    }

And here is how my input File looks like:

<html>
<head>
</head>
<body>
<table class="creditsuisse" width="100%" cellspacing="0" cellpadding="0">
      <tbody>
    <tr>
        <th>Name</th>
        <th style="width:170px;">Funktion</th>
        <th style="width:180px;">
        Amtsdauer (Seit)        </th>
        <th style="width:130px;">Alter (Geburtsdatum)</th>
        <th style="width:45px;">Neuigkeit</th>
      </tr>
            <tr>

          <td>
            <a onclick="document.location='/u/p/al_thani_jassim_hamad_j_j-9293792/credit_suisse_ag_CH-020.3.923.549-1.htm'" href="/u/p/al_thani_jassim_hamad_j_j-9293792/credit_suisse_ag_CH-020.3.923.549-1.htm">Al-Thani Jassim Hamad J.J.</a> *&nbsp;<br>

          </td>

          <td>
                          VR-Mitglied           
          </td>
                    <td><a onclick="document.location='http://www.moneyhouse.ch/u/pub/credit_suisse_ag_CH-020.3.923.549-1.htm#28.06.2010'" href="/u/pub/credit_suisse_ag_CH-020.3.923.549-1.htm#28.06.2010">2 Jahre (28.06.2010)</a></td>
                  <td>-</td>
          <td align="center"></td>
        </tr>
            <tr>

          <td>
            <a onclick="document.location='/u/p/albers_franz-4438178/credit_suisse_ag_CH-020.3.923.549-1.htm'" href="/u/p/albers_franz-4438178/credit_suisse_ag_CH-020.3.923.549-1.htm">Albers Franz</a> *&nbsp;<br>

          </td>

          <td>
                          VR-Mitglied           
          </td>
                    <td><a onclick="document.location='http://www.moneyhouse.ch/u/pub/credit_suisse_ag_CH-020.3.923.549-1.htm#04.05.1998'" href="/u/pub/credit_suisse_ag_CH-020.3.923.549-1.htm#04.05.1998">14 Jahre (04.05.1998)</a></td>
                  <td>-</td>
          <td align="center"></td>
        </tr>
     </tbody>
</table>
</body>
</html>
  • 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-16T16:36:08+00:00Added an answer on June 16, 2026 at 4:36 pm

    In order to read a local file in JSoup you would need to use the parse method that takes a File object rather than the one that takes HTML content. Replace

    Document doc = Jsoup.parse("C:\\...\\myFile.html", "UTF-8");
    

    with

    Document doc = Jsoup.parse(new File("C:\\...\\myFile.html"), "UTF-8");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.