Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6854497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:38:26+00:00 2026-05-27T01:38:26+00:00

I am having difficulties in retrieving 50 results from google. I’m using this: public

  • 0

I am having difficulties in retrieving 50 results from google.

I’m using this:

public static List Retrieve(String entry){
    List entryList = new ArrayList();

      try {  
             // string new entry is making the keywords into query that can be known by google
             String newEntry = (java.net.URLEncoder.encode(entry, "UTF-8").replace("+", "%20"));

             // inputing the keywords to google search engine
             URL url = new URL("http://www.google.co.id/search?q=" + newEntry + "&hl=en&num=10&lr=&ft=i&cr=&safe=images&tbs=");  
             // makking connection to the internet
             URLConnection urlConn = url.openConnection();  
             urlConn.setUseCaches(false);  
             urlConn.setRequestProperty("User-Agent", "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)");  

             // getting the input stream of page html into bufferedreader
             BufferedReader buffReader = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));  
             String line;  
             StringBuffer buffer = new StringBuffer();  

       // getting the input stream of html into stringbuffer       
       while ((line = buffReader.readLine()) != null) {  
        buffer.append(line);  
       }  

       // finding the links
        Pattern p = Pattern.compile(GOOGLE);
        Matcher m = p.matcher(buffer.toString().toLowerCase());
        while (m.find()) {
            String link = m.group(0);
            // putting the links of google search into list
            entryList.add(link);
        }
           } catch (Exception e) {  
            System.out.println(e.getMessage());  
           } 

    return entryList;
}

But it only shows only ten results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:38:26+00:00Added an answer on May 27, 2026 at 1:38 am

    loop through 5 times, each time adding 10 to the ‘start’ GET variable in the URL

    for(i=0;i<5;i++)
    {
        ...
        URL url = new URL("http://www.google.co.id/search?q=" + newEntry + "&hl=en&num=10&lr=&ft=i&cr=&safe=images&tbs=&start="+(i*10));
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having difficulties with forms, specifically ModelMultipleChoiceField. I've pieced together this code from
I'm having difficulties removing the lineStyle lines in JTrees using Netbeans. In a standalone
I am having difficulties sending the UDID from the iPhone to a PHP script
I'm having difficulties grasping how to do this. I am making a product options
I'm having difficulties adding momentum to my spinning wheel. I have this wheel (something
I'm having difficulties reading an app.config using the ConfigurationManager. I have a custom section,
im having difficulties figuring this out, ive looked at examples here and on the
I am developing a Swing/Java app but having difficulties passing data from the initiliaser
I'm having difficulties believing this question hasn't been asked before, but I couldn't find
So I'm almost done with this assignment but now I'm having difficulties again. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.