title: Jsoup scraping google results and get website link from button on the right side
body: <p>Currently I have made this function.</p>
  
  <pre><code>private static void getAllLinks(String URL) {
      try {
          doc = Jsoup.connect(URL).userAgent("Chrome").ignoreHttpErrors(true).get();
  
          Elements links = doc.select("div._mdf._ykh.kno-fb-ctx3 &gt; a");
          print("\nLinks: (%d)", links.size());
          for (Element link : links) {
               print("%s", link.attr("abs:href"));
              mainLinks.add(link.attr("abs:href"));
          }
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>and the link of the page is <a href="https://www.google.com/search?q=Ajo+Calvary+Baptist+Church" rel="nofollow noreferrer">https://www.google.com/search?q=Ajo+Calvary+Baptist+Church</a>.</p>
  
  <p><a href="https://i.stack.imgur.com/HMVEr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HMVEr.png" alt="see Image"></a></p>