URL url = new URL("http://www.google.com/search?q=hello+world");
url.openStream(); // returns an InputStream which you can read with e.g. a BufferedReader
Run Code Online (Sandbox Code Playgroud)
如果您以这种方式向Google重复提出编程请求,他们会开始将您重定向到"我们很抱歉,但您看起来像机器人"页面非常快.
你可能做得更好的是使用谷歌的自定义搜索API.
| 归档时间: |
|
| 查看次数: |
2190 次 |
| 最近记录: |