Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2004, 03:55 AM
Registered User
 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to make a query to google?

Hi,
I'm new. And I'm new in Java network, too. Now, I want to write a Java Application. Getting a WebPage from google.com is one of its functions.
For examples, I want to query with keyword "linux", so I use URL object, String url = "http://www.google.com/search?q=linux". But I couldn't do it. Exception was thrown at anytime!
Do you know how to get a query from google.com? Please show me the right way!
Could you understand my question? (because, I'm not good in English).
Waiting for your reply, goodbye! Thank you very much.
tqmk.

 
Old March 26th, 2004, 02:12 PM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to james_uk
Default

Get hold of googleapi.jar and do something like :-

GoogleSearch s = new GoogleSearch();
s.setKey(clientKey);
s.setQueryString("linux");
try {
   GoogleSearchResult r = s.doSearch();
   System.out.println(r.toString());
}catch (GoogleSearchFault f) {
   System.out.println(f.toString());
}


You get a client key, the jar file and more examples at :-
http://www.google.co.uk/apis/
Your English is fine.

James.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I make this query michael193nj Access 3 March 19th, 2008 05:13 PM
Make Table Query CongoGrey Access 2 June 1st, 2007 06:22 AM
how to make a query from an existing query raport SQL Language 3 November 13th, 2006 08:59 PM
Make table Query and Datepart marshaji Access 1 June 21st, 2005 12:36 PM
Error on Make-Table Query In Union Query rylemer Access 1 August 20th, 2003 07:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.