English 中文(简体)
获取前20名谷歌搜索结果c#api
原标题:get top 20 google results c# api

我一直在尝试写类似的东西,但没有成功,所以我想知道是否有任何谷歌API或任何其他“函数”可以让我执行以下操作

List<string> GetTop20Links (string keyword)
{
//code to download and return top 20 results (links) in List<string> format
}  
最佳回答
问题回答

据我从谷歌的博客中所知,曾经有一个(也许现在仍在运行)SOAP Web服务,可以让你查询结构化的搜索结果。但是,您需要一个所谓的API密钥来进行查询,而且他们不再提供这些密钥。该服务的后续产品据称是AJAX搜索API,但我找不到任何当前对它的引用。

google API页面有一个自定义搜索服务,但您必须提供搜索包含的特定网站集,您要么需要在显示结果的同时显示广告,要么需要支付一些使用费。

你看,让某人轻松地查询他们的搜索引擎,然后将结果用于任何目的,这不符合谷歌的利益。他们通过广告赚钱,这是他们的商业模式。

所以,如果你想实现这个功能,你必须转向html抓取,这充其量是丑陋的,往往会中断,而且很难正确。

顺便说一句:你可以用bing很容易地做到这一点。有一个指向Bing搜索API的链接http://msdn.microsoft.com/en-us/library/dd251056.aspx“rel=”nofollow“>此处和代码示例此处





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签