I want to extract information from this table:
HTML code for this table:
<tr>
<th>Rank</th>
<th>Level</th>
<th>IVs (A/D/S)</th>
<th>CP</th>
<th class="hidden-sm">Att</th>
<th class="hidden-sm">Def</th>
<th class="hidden-sm">Sta</th>
<th class="hidden-xs">Stat Product</th>
<th>% Max Stat</th>
</tr>
<tr class="table-danger">
<td><b>2997</b></td>
<td>19.0</td>
<td>12 / 0 / 5</td>
<td>1496</td>
<td class="hidden-sm">128.10</td>
<td class="hidden-sm">101.90</td>
<td class="hidden-sm">133</td>
<td class="hidden-xs">1736099</td>
<td>93.71%</td>
</tr>
<tr>
<td>1</td>
<td>19.0</td>
<td>0 / 14 / 14</td>
<td>1498</td>
<td class="hidden-sm">121.11</td>
<td class="hidden-sm">110.05</td>
<td class="hidden-sm">139</td>
<td class="hidden-xs">1852687</td>
<td>100.00%</td>
</tr>
...
I only can get this table and rows with this code:
Element table = document.select("table").get(0);
Elements rows = table.select("tr");
How to extract these stats? It should be:
Rank(2997) | Level (19.0) | IVs (12/0/5) | CP (1496) ...
With
Elements td = rows.select("td");
String stats = td.text();
I'll get one-line string: 2997 19.0 12 / 0 / 5 1496 128.10 101.90 133 1736099 93.71% 1 19.0 0... and it's hard to work with information.
I guess, I need to store them as Stat object with these fields and put it into Arraylist or smth.
But firstly, I need to extract this data more smoothly and don't put everything on one line. I need the power of Jsoup.
