-1

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(",", ""));

1 Answers1

0

if you are considering using third-party libraries, jsoup is a good idea.

https://jsoup.org/

using css / xpath selectors, you can indicate the element you are interested in, e.g.

//tr/td[contains (strong,.)]

will find all bold entries, then we can get the parent for that element, and read all the elements

http://xpather.com/

https://devhints.io/xpath

jsoup: How to select the parent nodes, which have children satisfying a condition

Patrickoo
  • 21
  • 3