使用java在雅虎中搜索 [英] Searching in yahoo using java

查看:45
本文介绍了使用java在雅虎中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我写了一个程序,用给定的字符串搜索雅虎.

Recently I wrote a program to search yahoo with a given string.

我传递给程序的字符串是http://api.search.yahoo.com/WebSearchService/V1/webSearch?site="+URLEncoder.encode(sitename)+"&appid=YahooDemo&query="+URLEncoder.encode(query)+"&results=20&start="+pagec+"&output=json.

The string I passed to my program is http://api.search.yahoo.com/WebSearchService/V1/webSearch?site="+URLEncoder.encode(sitename)+"&appid=YahooDemo&query="+URLEncoder.encode(query)+"&results=20&start="+pagec+"&output=json.

参数:

  • sitename 用于获取特定站点的结果
  • query 用于在雅虎服务器中搜索的字符串.
  • sitename for getting results for a particular site
  • query for string that to be searched in yahoo server.

但是当我执行这个程序时出现以下错误:

But I'm getting the following error when I execute this program:

{
    "Error": {
        "Message": ["The service has been shut down. For further details, please see the Deprecated Services blog post http://developer.yahoo.com/blogs/ydn/posts/2010/08/api_updates_and_changes"],
        "Title": "The following errors were detected:"
    }
}

出现此错误的原因是什么?

What is the cause for getting this error?

推荐答案

服务已关闭 自 2011 年 4 月起.您可以使用 Yahoo!改为搜索 BOSS,但您必须为此付费.

The service has been shut down since April 2011. You can use Yahoo! Search BOSS instead, but you've to pay for it.

您可以考虑改用 Google 自定义搜索 每天最多可免费查询 100 次,afaik.

You may consider switching to Google Custom Search which is free up to 100 queries per day, afaik.

这篇关于使用java在雅虎中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆