title: parsing a table with jsoup
body: <p>I'm trying to extract the e-mail adress and the phone number from a linkedin profile using jsoup, each of these informations is in a table. I have written a code to extract them but it doesn't work, the code should work on any linkedin profile. Any help or guidance would be much appreciated.</p>
  
  <pre><code>public static void main(String[] args) {
      try {
  
          String url = "https://fr.linkedin.com/";
          // fetch the document over HTTP
          Document doc = Jsoup.connect(url).get();
  
          // get the page title
  
          String title = doc.title();
          System.out.println("Nom &amp; Prénom: " + title);
          //  first method
          Elements table = doc.select("div[class=more-info defer-load]").select("table");
          Iterator &lt; Element &gt; iterator = table.select("ul li a").iterator();
          while (iterator.hasNext()) {
              System.out.println(iterator.next().text());
          }
          // second method
          for (Element tablee: doc.select("div[class=more-info defer-load]").select("table")) {
              for (Element row: tablee.select("tr")) {
                  Elements tds = row.select("td");
                  if (tds.size() &gt; 0) {
                      System.out.println(tds.get(0).text() + ":" + tds.get(1).text());
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>here is an example of the html code that i'm trying to extract (taken from a linkedin profile)</p>
  
  <pre><code>&lt;table summary="Coordonnées en ligne"&gt;
     &lt;tr&gt;
        &lt;th&gt;E-mail&lt;/th&gt;
        &lt;td&gt;
           &lt;div id="email"&gt;
              &lt;div id="email-view"&gt;
                 &lt;ul&gt;
                    &lt;li&gt;
                       &lt;a href="mailto:adam1adam@gmail.com"&gt;adam1adam@gmail.com&lt;/a&gt;
                    &lt;/li&gt;
                 &lt;/ul&gt;
              &lt;/div&gt;
           &lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr class="no-contact-info-data"&gt;
        &lt;th&gt;Messagerie instantanée&lt;/th&gt;
        &lt;td&gt;
           &lt;div id="im" class="editable-item"&gt;
           &lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr class="address-book"&gt;
        &lt;th&gt;Carnet d’adresses&lt;/th&gt;
        &lt;td&gt;
           &lt;span class="address-book"&gt;
           &lt;a title="Une nouvelle fenêtre s’ouvrira" class="address-book-edit" href="/editContact?editContact=&amp;contactMemberID=368674763"&gt;Ajouter&lt;/a&gt; des coordonnées.
           &lt;/span&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  &lt;table summary="Coordonnées"&gt;
     &lt;tr&gt;
        &lt;th&gt;Téléphone&lt;/th&gt;
        &lt;td&gt;
           &lt;div id="phone" class="editable-item"&gt;
              &lt;div id="phone-view"&gt;
                 &lt;ul&gt;
                    &lt;li&gt;0021653191431&amp;nbsp;(Mobile)&lt;/li&gt;
                 &lt;/ul&gt;
              &lt;/div&gt;
           &lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr class="no-contact-info-data"&gt;
        &lt;th&gt;Adresse&lt;/th&gt;
        &lt;td&gt;
           &lt;div id="address" class="editable-item"&gt;
              &lt;div id="address-view"&gt;
                 &lt;ul&gt;
                 &lt;/ul&gt;
              &lt;/div&gt;
           &lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>