【问题标题】:How can i get my python program to get answers from google?如何让我的 python 程序从谷歌获得答案?
【发布时间】:2016-11-12 15:21:43
【问题描述】:

所以,我正在编写一个 python AI 并试图让它与钢铁侠中的 JARVIS 相似。它进展顺利,但我想做以下事情: 所以,如果你现在去搜索“Gorge Harrison 是怎么死的?”,google 会显示“Lung Cancer”,然后是其他网站。当被问到这个问题时,我希望 AI 去 google 并将答案存储在一个变量中。

我想将它存储在一个变量中,因为我正在使用 os 模块,并且我正在使用它来使 AI talk(os.system("spd-say 'hello'") 或 os.system("spd-说 '" + 变量 + "'"))

【问题讨论】:

    标签: search artificial-intelligence bots


    【解决方案1】:

    使用requests模块构造一个http请求,然后解析返回的json。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多