【问题标题】:Is there a way to find google search results for a certain keyword with javascript? [closed]有没有办法用 javascript 找到某个关键字的谷歌搜索结果? [关闭]
【发布时间】:2017-03-20 17:06:44
【问题描述】:

我正在寻找一种使用 javascript 查找来自 google 的搜索结果的方法。

【问题讨论】:

  • 使用 html 敏捷性将其废弃

标签: javascript web google-search


【解决方案1】:

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

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

请查看此official link 了解示例和更多信息。

这里是一个http get请求示例

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

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

你可以找到使用Javascript请求google的apihere的完整参考。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-02
    相关资源
    最近更新 更多