Possible Duplicate:
ja开发者_开发百科va program to retreive page source from google search automatically
hi friends, I just give any word in google search and search the output for that particular word. I want java program to retrieve page source from google search automatically for that particular word. Its very urgent. Give any suggestions. Thanks
Whether this is possible or not doesn't really matter: Google doesn't want you to do that. They have a public AJAX-search API developers can use: http://code.google.com/apis/ajaxsearch/web.html
The "page source" is the the raw HTML that is returned from the web server, so you can get this text by simply submitting an HTTP request to google, and reading the HttpResponse.
Check out the HttpClient for Java for submitting an HTTP request.
Try running a Google search for any word. Once you get to the search results page, look at what appears in the Address bar. You'll probably want to submit something like this as an HTTP GET.
精彩评论