以编程方式获取 Google 搜索结果

发布于 2024-08-04 09:40:44 字数 47 浏览 3 评论 0原文

如何从程序内部获取 Google 搜索结果?我需要获取指定字符串的搜索结果数组。

How can I get Google search results from inside a program? I need to get an array of search results for a specified string.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

如痴如狂 2024-08-11 09:40:44

C++ 比其他语言需要更多的工作。您需要连接到 Google 的 REST Search API,然后使用 JSON解析器解析搜索结果。 Json.org 拥有各种语言的 JSON 解析器集合。

C++ requires a little more work then other languages. You will need to connect to Google's REST Search API and then use a JSON parser to parse out the search results. Json.org has a collection of JSON parsers in various languages.

情丝乱 2024-08-11 09:40:44

使用他们的 javascript 搜索 API http://code.google.com/apis/ajaxsearch/

他们遗憾的是,不再支持他们的 SOAP 搜索 api

Use their javascript search API http://code.google.com/apis/ajaxsearch/

They no longer support their SOAP search api unfortunately

素罗衫 2024-08-11 09:40:44

所以……九年后,你不能再这样做了。您确实得到了 JSON,但它很短,只是说“Google Web Search API 不再可用。请迁移到 Google Custom Search API (https://developers.google.com/custom-search/)"

Google 自定义搜索可以使用“Thing”schema.org 主题搜索整个网络。 https://support.google.com/customsearch/回答/4513886?visit_id=636769478248533420-865620074&rd=1

So... nine years later, you can no longer do that. You do get JSON, but it's quite short and just says "The Google Web Search API is no longer available. Please migrate to the Google Custom Search API (https://developers.google.com/custom-search/)"

Google Custom Search can search the entire web using the 'Thing' schema.org topic. https://support.google.com/customsearch/answer/4513886?visit_id=636769478248533420-865620074&rd=1

朕就是辣么酷 2024-08-11 09:40:44

Google 为 JavaScript 程序员提供了 Ajax API,并且为 Python、PHP 和 Flash 提供了糟糕的文档。顺便说一句,如果您能够使用任何其他 C++ 库连接到远程 http 服务器,您就可以做到。只需更改您正在使用的网址并将其指向: http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={My_CPP_Query}
您将获得可以使用的 JSON 数据流。

Google offers Ajax API for JavaScript programmers and a poor documentation for Python, PHP and Flash.By the way, If you are able to connect to remote http server with any other c++ library, you can do it. just change the url you are using and point it to: http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={My_CPP_Query}
You will get JSON data stream, that you will be able to work with.

半边脸i 2024-08-11 09:40:44

我记得我看过 youtube 教程,不确定库名称,但它类似于 _NT_SEARCH_GH:etcetcetcetcetc;

i remember i saw youtube tutorial on doing that, not sure about the library name but its something like _NT_SEARCH_GH:etcetcetcetcetcetc;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文