I'm looping through a load of HTML and I'm trying to just extract the parts I need.
I need to just get 'THISISTHEBITIWANT' from the html below.
<li class="aClass">
<a href="example/THISISTHEBITIWANT">example</a>
</li>
<li class="aClass">
<a href="example/THISISTHEBITIWANT">example2</a>
</li>
Each time I only want to get the 'THISISTHEBITIWANT' and the text in the link will change. I've looked at string replace - but as I don't know what 'example' or 'example2' is going to be each time, I can only remove up until 'example/' at the moment.
This was my Java code:
html = inputLine.replace("<li class=\"aClass\"><a href=\"/example/", "");
If anyone could offer any advice, it would be much appreciated!