Jsoup get href within a class

Viewed 18431

I have this html code that I need to parse <a class="sushi-restaurant" href="/greatSushi">Best Sushi in town</a>

I know there's an example for jsoup that you can get all links in a page,e.g.

Elements links = doc.select("a[href]");
for (Element link : links) {
print(" * a: <%s>  (%s)", link.attr("abs:href"),
trim(link.text(), 35));
}

but I need a piece of code that can return me the href for that specific class.

Thanks guys

2 Answers
Related