0

I've made 1 function in JavaFX I'm new in java don't know much functions about it and maybe its a silly question but what I did is I made 1 function which do a http call to google and get its response I found the result structure and select it but its a full string of 10 records I want all 10 records separate for example record is

<li class="g"><h3 class="r"><a href="/url?q=http://in.linkedin.com/in/mohitbumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CBsQFjAA&amp;usg=AFQjCNH6e1bxBXMBvQc2a6_AuNLt-OXc7Q"><b>Mohit Bumb</b> - India | LinkedIn</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>in.linkedin.com/in/<b>mohitbumb</b></cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CBwQ7B0wAA" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/search?q=related:in.linkedin.com/in/mohitbumb+mohit+bumb&amp;tbo=1&amp;sa=X&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CB4QHzAA">Similar</a></li>
     </ul>
    </div>
   </div>
  </div>
  <div class="f slp">
   Ujjain, Madhya Pradesh, India&nbsp;-&nbsp;CTO at SITS SolutionS
  </div>
  <span class="st">View <b>Mohit Bumb's</b> (India) professional profile on LinkedIn. LinkedIn is the <br /> world's largest business network, helping professionals like <b>Mohit Bumb</b> discover<br /> &nbsp;<b>...</b></span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=http://stackoverflow.com/users/1470999/mohit-bumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CCEQFjAB&amp;usg=AFQjCNHmVEhw0qLf4t0oKUTOJU2mQduF0g">User <b>Mohit Bumb</b> - Stack Overflow</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>stackoverflow.com/users/1470999/<b>mohit</b>-<b>bumb</b></cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CCIQ7B0wAQ" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:vvOM4noKbrEJ:http://stackoverflow.com/users/1470999/mohit-bumb%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CCQQIDAB&amp;usg=AFQjCNEeKzi1Yq3u-fvJ55M0agBomQJQ3w">Cached</a></li>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/search?q=related:stackoverflow.com/users/1470999/mohit-bumb+mohit+bumb&amp;tbo=1&amp;sa=X&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CCUQHzAB">Similar</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st">Hello, I'm working as a Chief Technical Officer in a well known company at Ujjain. <br /> I've 3 years experience in web development field. I can perform any kind of&nbsp;<b>...</b></span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=https://www.facebook.com/mohitbumbrocks&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CCcQFjAC&amp;usg=AFQjCNEKABtg_Ri0VNyN9Ruv-TapxBskTQ"><b>MOHIT BUMB</b> ROCKS | Facebook</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>https://www.facebook.com/<b>mohitbumb</b>rocks</cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CCgQ7B0wAg" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:3Q2RQ_YbWHkJ:https://www.facebook.com/mohitbumbrocks%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CCoQIDAC&amp;usg=AFQjCNFwK_exvgqJjk7vdMQ17GMGU_i4DA">Cached</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st"><b>MOHIT BUMB</b> ROCKS, Ujjain, India. 2419 likes &middot; 4 talking about this. http://<br /> facebook.com/themohitbumb.</span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=http://profiles.wordpress.org/mohitbumb/&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CCwQFjAD&amp;usg=AFQjCNGadzF7Wasakh7nXeh0ds4Skt6-Pg">WordPress › Profiles &raquo; <b>Mohit Bumb</b></a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>profiles.wordpress.org/<b>mohitbumb</b>/</cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CC0Q7B0wAw" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:jGhtWnjmfzcJ:http://profiles.wordpress.org/mohitbumb/%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CC8QIDAD&amp;usg=AFQjCNGZ2esflGvt1byyG4llmYcH-ct9ZQ">Cached</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st">Location. This user has not filled out their location yet. <b>Mohit's</b> Plugins. WP <br /> Redirect Mobile. 1,731 downloads. <b>Mohit's</b> Activity. Replied to a topic in the WP.<br /> org&nbsp;<b>...</b></span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/images?q=mohit+bumb&amp;hl=en&amp;sa=X&amp;oi=image_result_group&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CDEQsAQ">Images for <b>mohit bumb</b></a></h3><br />
 <div>
  <a href="/url?q=https://twitter.com/RealMohitBumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CDMQ9QEwBA&amp;usg=AFQjCNHgvU2s23Y4WS4DaudpcyNTS0YMSg"><img height="89" src="http://t3.gstatic.com/images?q=tbn:ANd9GcTKxylfoAi1mz3C_B2YXF09_irR33Rw1BOB_wGLrZCxKOfg8KR4JsBw0Q" width="89" align="middle" alt="" border="0" style="margin:3px 0;margin-right:6px;padding:0" /></a>
  <a href="/url?q=https://forums.digitalpoint.com/members/mohit-bumb.745047/&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CDUQ9QEwBQ&amp;usg=AFQjCNHOD2CkMZuejaN3Q8JjLolnslsTiQ"><img height="87" src="http://t1.gstatic.com/images?q=tbn:ANd9GcT2lChwuKNMj0MXbsinykZjVQai03a25JuiLg9qXldcSJCPpt_DmPsexjY" width="65" align="middle" alt="" border="0" style="margin:3px 0;margin-right:6px;padding:0" /></a>
  <a href="/url?q=http://profiles.wordpress.org/mohitbumb-1/&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CDcQ9QEwBg&amp;usg=AFQjCNG_bKvl-NhGiBUfQczFnqPs7ePC6Q"><img height="87" src="http://t2.gstatic.com/images?q=tbn:ANd9GcQhuf-oTUn-OZJBW_uS5va0l1UOgq_PlLKVLK6HBCDcdExdgkfWMWiUSJg" width="87" align="middle" alt="" border="0" style="margin:3px 0;margin-right:6px;padding:0" /></a>
  <a href="/url?q=https://twitter.com/real_mohit_bumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CDkQ9QEwBw&amp;usg=AFQjCNFKJYwGmDZBllMQhmS9AdyzmcvlNQ"><img height="89" src="http://t1.gstatic.com/images?q=tbn:ANd9GcSmkdH2HGdLIVfldp4Y5y_kTV-5bzZsjXQyIA2OsZ86cQByBeT8l9Ar27Q" width="89" align="middle" alt="" border="0" style="margin:3px 0;margin-right:6px;padding:0" /></a>
  <a href="/url?q=http://stackoverflow.com/users/863317/mohit-bumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CDsQ9QEwCA&amp;usg=AFQjCNFg8cq-MbrcESnC_kS-tse-NmVrzA"><img height="87" src="http://t0.gstatic.com/images?q=tbn:ANd9GcQY9PGwUKCMxKKYDwxKLRN6z5OZbI9NE9hIrJld6HaZ2PHWxPwRkmY8OhQ" width="87" align="middle" alt="" border="0" style="margin:3px 0;margin-right:6px;padding:0" /></a>
  <a href="/url?q=http://www.pinterest.com/liverockers/&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CD0Q9QEwCQ&amp;usg=AFQjCNEFSmnPWGOJC_uMBMv8Cq54BIFfwA"><img height="87" src="http://t0.gstatic.com/images?q=tbn:ANd9GcTR5yce2XjPLEwVQrf0l4uHg6lX9eUMSWBsKNBdSPigoqKmW2ZJIM3JUi4" width="87" align="middle" alt="" border="0" style="margin:3px 0;margin-right:6px;padding:0" /></a>
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=http://www.crunchbase.com/person/mohit-bumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CD8QFjAK&amp;usg=AFQjCNHCtisiZI9IAy53-_de2YCvXYX84A"><b>Mohit Bumb</b> | CrunchBase Profile</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>www.crunchbase.com/person/<b>mohit</b>-<b>bumb</b></cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CEAQ7B0wCg" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:kN1oPmwDcS8J:http://www.crunchbase.com/person/mohit-bumb%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CEIQIDAK&amp;usg=AFQjCNFSiUT5MMwG59ky6HaMjjVFoG2gmA">Cached</a></li>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/search?q=related:www.crunchbase.com/person/mohit-bumb+mohit+bumb&amp;tbo=1&amp;sa=X&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CEMQHzAK">Similar</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st"><b>Mohit Bumb</b> is 18 years old sr. web developer at luutaa technologies, indore. <br /> He's also blogger and write articles on.</span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=http://www.guru.com/freelancers/Mohit-Bumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CEUQFjAL&amp;usg=AFQjCNF6gPSxdtesnodXoSD4ah27ciz_Cw"><b>Mohit Bumb</b>, Indore, India, Web Developer, Website Designer, SEO <b>...</b></a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>www.guru.com/freelancers/<b>Mohit</b>-<b>Bumb</b></cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CEYQ7B0wCw" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:tK0v8zti9h4J:http://www.guru.com/freelancers/Mohit-Bumb%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CEgQIDAL&amp;usg=AFQjCNEfi9FiXNw3Iw_qELMh0PZvuoZFkw">Cached</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st">Find Web Developer -- <b>Mohit Bumb</b> (Indore, India) -- for Hire. Review This <br /> Freelancer's Qualifications, Reviews and Rate on Guru.com. Easily Contact for a <br /> Free&nbsp;<b>...</b></span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=https://twitter.com/real_mohit_bumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CEoQFjAM&amp;usg=AFQjCNFKJYwGmDZBllMQhmS9AdyzmcvlNQ"><b>Mohit Bumb</b> (real_mohit_bumb) on Twitter</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>https://twitter.com/real_<b>mohit</b>_<b>bumb</b></cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CEsQ7B0wDA" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:dXxv0wr7bxgJ:https://twitter.com/real_mohit_bumb%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CE0QIDAM&amp;usg=AFQjCNFzYxvh_Eb_7kR3y6j9hj_a8x03_A">Cached</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st">The latest from <b>Mohit Bumb</b> (@real_mohit_bumb). i'm 17 years old boy studying <br /> private and designing website, some people already using my name here but&nbsp;<b>...</b></span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=https://twitter.com/RealMohitBumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CE8QFjAN&amp;usg=AFQjCNHgvU2s23Y4WS4DaudpcyNTS0YMSg"><b>Mohit Bumb</b> (RealMohitBumb) on Twitter</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>https://twitter.com/Real<b>MohitBumb</b></cite>
  </div>
  <span class="st">The latest from <b>Mohit Bumb</b> (@RealMohitBumb). I'm 18 years old web developer <br /> from Indore (Luutaa Technologies) and also doing bca from ujjain (Advance&nbsp;<b>...</b></span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=http://photobucket.com/images/MOHIT%2BBUMB%2BROCKS/&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CFEQFjAO&amp;usg=AFQjCNGypIx7RMZ2u9WPobBFittoI8ljIw"><b>MOHIT BUMB</b> ROCKS Pictures, Images &amp; Photos | Photobucket</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>photobucket.com/images/<b>MOHIT</b>+<b>BUMB</b>+ROCKS/</cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CFIQ7B0wDg" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:BbkcFBNUQwMJ:http://photobucket.com/images/MOHIT%252BBUMB%252BROCKS/%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CFQQIDAO&amp;usg=AFQjCNHPoMqG3Fce5IRpz2zgNIzL5yXXDA">Cached</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st">View the 2 best <b>MOHIT BUMB</b> ROCKS Photos, <b>MOHIT BUMB</b> ROCKS Images, <br /> <b>MOHIT BUMB</b> ROCKS Pictures. Download photos or share to Facebook, Twitter,<br /> &nbsp;<b>...</b></span>
  <br />
 </div></li>
<li class="g"><h3 class="r"><a href="/url?q=http://math.stackexchange.com/users/15374/mohit-bumb&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CFYQFjAP&amp;usg=AFQjCNHh7JQzEdQQEiJeaF56lPs52UpPew">User <b>Mohit Bumb</b> - Mathematics Stack Exchange</a></h3>
 <div class="s">
  <div class="kv" style="margin-bottom:2px">
   <cite>math.stackexchange.com/users/15374/<b>mohit</b>-<b>bumb</b></cite>
   <div class="am-dwn-arw-container">
    ‎
    <div onclick="google.sham(this);" aria-expanded="false" aria-haspopup="true" tabindex="0" data-ved="0CFcQ7B0wDw" style="display:inline">
     <span class="am-dwn-arw"></span>
    </div>
    <div class="am-dropdown-menu" role="menu" tabindex="-1" style="display:none">
     <ul>
      <li class="am-dropdown-menu-item"><a class="am-dropdown-menu-item-text" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:wkyfFmZMfdEJ:http://math.stackexchange.com/users/15374/mohit-bumb%252Bmohit%2Bbumb%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ei=4d_0UszCBI3yiAe9t4HwDQ&amp;ved=0CFkQIDAP&amp;usg=AFQjCNFesiYgW00uHQmrZWtb2GDIx-Rvig">Cached</a></li>
     </ul>
    </div>
   </div>
  </div>
  <span class="st">22 Oct 2013 <b>...</b> Hello, I'm working as a Chief Technical Officer in a well known company at Ujjain. <br /> I've 3 years experience in web development field.</span>
  <br />
 </div></li>

Its 10 li with class g but I want all it in sep. so I can show this li's according to me what I'm looking for is loop according to element class or all these elements in 1 array so I can write loop for it

Codes :

 private void callUrl(String keywords) throws Exception {
        String url = "http://www.google.com/search?q="+URLEncoder.encode(keywords); 
        Document response = Jsoup.connect(url)
                            .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                            .referrer("http://www.google.com").get();
        Elements records = response.select("body #ires li.g");
        //record = records.split(".g");
        System.out.println(records); System.exit(0);
     }

2 Answers 2

1

I am still trying to figure out a complete answer, and I am sorry to answer a question with another question.

I used two Patterns to find all the places where <li> and </li> are found.

//Your string
String bigString = "<div><li><div><li></li></div></li></div><li><div><li></li></div></li>";

Pattern li_start = Pattern.compile("<li>");  
Pattern li_end = Pattern.compile("</li>");

Matcher m_li_start = li_start.matcher(bigString);
Matcher m_li_end = li_end.matcher(bigString);

List<Integer> list_of_li = new ArrayList<>();
List<Integer> list_of_li_close = new ArrayList<>();

    while (m_li_start.find()) {
        int index_of_li = m_li_start.start(); //finds 1st index of <li>
        list_of_li.add(index_of_li);
    }

    while (m_li_end.find()) {            
        int index_of_close_li = m_li_end.end(); //finds last index of </li>
        list_of_li_close.add(index_of_close_li);            
    }

When I print both list in the console I get the position of each <li> and </li>

[5, 14, 40, 49]    //all index of <li>
[13, 24, 42, 53]  //all last index of </li> 

Now we know a combination of 1 item on each list is the answer you are looking for, in this case:

//print from [0,24] - 1st block of <li></li>
//print from [29,53] - 2nd block of <li></li>

Now how to get that answer still puzzles me, but I hope this helps you at least a little. Again, sorry I couldn't help you with a better answer.

Sign up to request clarification or add additional context in comments.

1 Comment

wow! your answer shows why i should read about records before hand XD, anyhow i am still a newbie :P
1

Got it by myself

String url = "http://www.google.com/search?q="+URLEncoder.encode(keywords); 
        Document response = Jsoup.connect(url)
                            .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
                            .referrer("http://www.google.com").get();
        Elements records = response.select("body #ires li.g");
        for (int i = 0; i < records.size()-1; i++) {
            System.out.println(records.get(i));
        }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.