有没有一种方法可以使用javascript查找某个关键字的google搜索结果? [英] Is there a way to find google search results for a certain keyword with javascript?

查看:81
本文介绍了有没有一种方法可以使用javascript查找某个关键字的google搜索结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种使用javascript从Google查找搜索结果的方法.

I am looking for a way to find search results from google with javascript.

推荐答案

是的,您可以使用Google的api从Google获取搜索结果.

Yes, you can use Google's api to fetch search result from Google.

但是为此,您必须从Google获得API密钥,然后才能使用Google的api来获取结果.

But for that you have to get a API key from Google and then you can use google's api to fetch result.

请检查此官方链接以了解示例和更多.

Please check this official link to know example and more.

这是一个示例http get请求

Here is an example http get request

https://www.googleapis.com/customsearch/v1?key=INSERT_YOUR_API_KEY&cx=017576662512468239146:omuauf_lfve&q=lectures

您可以简单地使用ajax从您的JavaScript请求这些http get请求. 在上面的示例中,您可以将演讲替换为要搜索的关键字.

you can simply request these http get request from your javascript using ajax. In the above example you can replace the word lectures with the key word that you want to search.

您可以找到使用Javascript请求Google的api的完整参考这里.

You can find complete reference of using Javascript to request google's api here.

这篇关于有没有一种方法可以使用javascript查找某个关键字的google搜索结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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