开发者

is it possble to retreive page source from google search automatically by using java program? [duplicate]

开发者 https://www.devze.com 2022-12-18 14:21 出处:网络
This question already exists: Closed 12 years ago. Possible Duplicate: ja开发者_开发百科va program to retreive page source from google search automatically
This question already exists: Closed 12 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消