title: How to extract HTML table data using Java from a website?
body: <p>I've got this website:
  <a href="http://www.bloomberg.com/markets/stocks/movers/ftse-100/" rel="nofollow">www.bloomberg.com</a> </p>
  
  <p>And I want to extract the name and price for each company listed; i've looked around but the following code i found doesn't work? </p>
  
  <pre><code>import java.io.IOException;
  
  import org.jsoup.Jsoup;
  import org.jsoup.nodes.Document;
  import org.jsoup.nodes.Element;
  import org.jsoup.select.Elements;
  
  
  
  public class testing {
  public static void main(String[] args) {
  
  
      Document doc;
      try {
          doc = Jsoup.connect("http://http://www.bloomberg.com/markets/stocks/movers/ftse-100/").get();
  
  
      for (Element table : doc.select("table[class=index_members_table dual_border_data_table market_sortable_table alt_rows_stat_table]")) {
           for (Element row : table.select("tr")) {
              Elements tds = row.select("td");
              System.out.println(tds.get(0).text() + "-&gt;" + tds.get(1).text());
           }
  
      }
      } catch (IOException e) {
  
          e.printStackTrace();
      }
  
  }
  }
  </code></pre>