That should be rather simple...
Source source=new Source(new StringReader(inputString));
Element aElement = source.getFirstElement(HTMLElementName.A);
String href = aElement.getAttributeValue("href");
System.out.println(href);
... although this makes some assumptions, of course: Namely, that the inputString
is only the string that you posted (and that this part is not enclosed in other tags), and that this part only contains a single link (a
).
(If these assumptions are not valid, one somehow has to identify this particular div
and the correct a
tag. For example, by searching for a div
with the attribute class="itm hasOverlay lastrow"
and for a a
with the class class="itm-link itm-drk trackingOnClick"
- in any case, one has to know more about the actual structure of the document from which this information should be extracted)