views:

19

answers:

0

Hello,

I am trying to use a Java App to search Google in different countries, i.e. google.co.uk, google.de, etc. I found that the Google Ajax API used with Java will only let you do web search with the following

URL url = new URL( "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&" + "q=information%20retrieval&key=INSERT-YOUR-KEY&userip=USERS-IP-ADDRESS");

URLConnection connection = url.openConnection();

connection.addRequestProperty("Referer", /* Enter the URL of your site here */);

however, that just gives me google.com's results. I need separate results for each country. Is there anyway to do this with Java.

Google has local search, but that's based on Google Maps, and it uses longitude and latitude, and provides business search results. I need web pages specific to each country.

Any ideas..

I was trying to scrape google.co.uk's search result with the following:

http://www.google.co.uk/#hl=en&source=hp&q=information+retrieval&aq=f&aqi=g10&aql=&oq=&gs_rfai=CjqZ0vBeYTLfwMZz0ygTJ84WADgAAAKoEBU_Qz3dV&fp=44fc429e19c3a006

but the returned result is an empty page. Any one know a workaround?

thanks

Sam