hello i need little help reading website content
i want to read
<tr>
<td class="text-center"><strong>This Month</strong></td>
<td class="text-center">1194</td>
<td class="text-center">22</td>
<td class="text-center">7</td>
</tr>
i make it like this but it always return nothing
if (url.toLowerCase().contains("top100arena.com") && line.contains("<strong>This Month</strong></td><td class=\"text-center\">"))
return Integer.valueOf(line.split(">")[1].replace("</td", "").replace(",", ""));
if you are considering using third-party libraries, jsoup is a good idea.
using css / xpath selectors, you can indicate the element you are interested in, eg
//tr/td[contains (strong,.)]
will find all bold entries, then we can get the parent for that element, and read all the elements
jsoup: How to select the parent nodes, which have children satisfying a condition
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.