title: Using JSoup to scrape Google Results
body: <p>I'm trying to use JSoup to scrape the search results from Google. Currently this is my code. </p>
  
  <pre><code>public class GoogleOptimization {
  public static void main (String args[])
  {
      Document doc;
      try{
          doc = Jsoup.connect("https://www.google.com/search?as_q=&amp;as_epq=%22Yorkshire+Capital%22+&amp;as_oq=fraud+OR+allegations+OR+scam&amp;as_eq=&amp;as_nlo=&amp;as_nhi=&amp;lr=lang_en&amp;cr=countryCA&amp;as_qdr=all&amp;as_sitesearch=&amp;as_occt=any&amp;safe=images&amp;tbs=&amp;as_filetype=&amp;as_rights=").userAgent("Mozilla").ignoreHttpErrors(true).timeout(0).get();
          Elements links = doc.select("what should i put here?");
          for (Element link : links) {
                  System.out.println("\n"+link.text());
      }
      }
      catch (IOException e) {
          e.printStackTrace();
      }
  }
  
  }
  </code></pre>
  
  <p>I'm just trying to get the title of the search results and the snippets below the title. So yea, I just don't know what element to look for in order to scrape these. If anyone has a better method to scrape Google using java I would love to know.</p>
  
  <p>Thanks.</p>