Tbuermann
Tbuermann

Reputation: 93

Extracting a href using jsoup

Hey I am trying to extract this link:

https://aulib.abdn.ac.uk:443/F/PEYK3FS2A56KCUKNUE2DNC111QPYC4T1AIPEQ3VP7VXK27HHFM-41314?func=short-sort&set_number=010039

From this Screenshot

I have tried using:

 Elements headings = doc.select("th:eq(2)");

But that seams to reutn the whole line instead of just the link. My question is how would I extract only the link?

Thank you

Upvotes: 0

Views: 106

Answers (1)

Torious
Torious

Reputation: 3424

Try doc.select("th:eq(2) > a").first().attr("href")

Upvotes: 2

Related Questions