Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>--- see update below ---</p> <p>Please realize this is a fragile in that any change to the site could potentially break this. You'll also want to do some error checking and whatnot. Also, I didn't see the "6 pts in last 2 GP" text like you have above, but you can grab whatever stat you want using this code. Just change the <code>stats.get(4)</code> to whatever you want.</p> <pre><code> Document doc = Jsoup.connect("http://forecaster.thehockeynews.com/hockeynews/hockey/statistics.cgi?mlb&amp;mode=hotnot/").get(); for (Element e : doc.select(".FSS-data-row")) { Element td = e.select("td.FSS-data-left &gt; a").first(); String name = (td != null?td.text():null); Elements stats = e.select(".FSS-data-right"); String goals = (stats.size() &gt; 0?stats.get(4).text():null); System.out.println(name + ":" + goals); } </code></pre> <p>Sample output:</p> <pre><code>null:null J. Benn:13 P. Sharp:20 P. Marleau:17 T. Oshie:14 </code></pre> <p>The first null:null is because that is like the header row on the page.</p> <hr> <h2>-----UPDATE-----</h2> <p>The url you had in your post pointed to the wrong page. Here is updated code to get what I think you want..</p> <pre><code> Document doc = Jsoup.connect("http://forecaster.thehockeynews.com/hockeynews/hockey/statistics.cgi?&amp;mode=hotnot").get(); for (Element e : doc.select("tr.FSS-data-row-highlight")) { Element tdname = e.select("td &gt; a").first(); String name = (tdname != null?tdname.text():null); Element tdstat = e.select("td.FSS-data-right").first(); String stat = tdstat.text(); System.out.println(name + ":" + stat); } </code></pre> <p>Sample output:</p> <pre><code>Mathieu Perreault:5 pts in last 2 GP  Mikhail Grabovski:5 pts in last 2 GP  James Neal:4 pts in last 2 GP  Kris Versteeg:4 pts in last 2 GP  Evgeni Malkin:12 pts in last 6 GP  </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload