I know that in Jsoup when you want to find a certain Element with a link in it, you can do this:
Document doc = Jsoup.parse(text);
Element links = doc.select("[href]");
This however, takes all links to every website in the page…
But what if I have multiple links, and I only want to retrieve the ones specifically linking to google. For instance:
<a href="http://www.google.com">Google</a>
<a href="http://www.bing.com">Bing</a>
<a href="http://www.google.com">Another Google</a>
And I want it to take only those with google in it. I tried doing something like this:
Element links = doc.select("[href=\"http://www.google.com\"]");
But this doesn’t work… does anyone have a suggestion?
Have you tried simply this: