How to search in google by using java code?

2019-07-04 03:08发布

How to search in google by using java code?

2条回答
虎瘦雄心在
2楼-- · 2019-07-04 03:19

Unfortunately the SOAP API has been deprecated. But you can use the AJAX API for non-JavaScript purposes as well, see for example:

http://www.ajaxlines.com/ajax/stuff/article/using_google_is_ajax_search_api_with_java.php

Update Jul 3 2018: This link is now broken; some code from there can be found here: https://stackoverflow.com/a/1546475/55787, and I found a copy of the article here: https://blog.csdn.net/hgd250/article/details/5214702 Furthermore the orginial link to the AJAX API is now broken, too. It seems that this one is closest to the original meaning: https://developers.google.com/custom-search/json-api/v1/overview?csw=1

See also this StackOverflow question:

查看更多
Rolldiameter
3楼-- · 2019-07-04 03:31

I would have told you to use one of their API. Unfortunatly, there does not seems to exist one for search. As a consequence, you'll have to use HtmlUnit to emulate a browser and go see their results (obviously, you can go the harder way and do some HTTP queries by yourself. But who would do that ?).

查看更多
登录 后发表回答