I have been trying to get a number from a html string, but I cannot come up with a way to do it properly, I already looked for instructions for Jsoup, but I don’t really understand how it works.
This is one of the strings I have to parse:
<span class="b"><a href="/paline/linea/014?id_palina=76954&nav=5#pal">014</a>:</span>
What I’m trying to get as output is 014, the name of the link. I need to get the number in a String variable, not Integer by the way.
Or this
<span class="b"><a href="/paline/percorso/50268?id_palina=76954&nav=5#pal">08</a>:</span>
For the 08.
The main problem I’m finding is that two things change in the string, the number after /paline/percorso/ and the number which is the name of the link. Could someone please help me?
If all your samples are like this, you can do this with simple string functions: