【问题标题】:How to get the content of "Google Dictionary" by python script如何通过python脚本获取“谷歌词典”的内容
【发布时间】:2011-02-12 06:05:53
【问题描述】:

感谢the script,我已经成功登录google了。
但是我将“gv_home_page_url”的值替换为http://www.google.com.tw/dictionary/wordlist?hl=zh-TW,出现错误。

消息是 " urllib2.HTTPError: HTTP 错误 500: 内部服务器错误"

任何想法将不胜感激,谢谢。

【问题讨论】:

  • 在浏览器中打开页面时,除了使用 google.com/dictionary/wordlist?hl=zh-TW 而不是 .com.tw 之外,您无事可做。同样的错误 500。
  • 你的意思是即使你用浏览器打开,也会出现同样的错误?它对我有用,你登录谷歌了吗?

标签: python web-services web-applications


【解决方案1】:

这不是一个有效的 URL。如果您尝试在您的栏中输入它,您将被重定向到 Google 搜索结果。使用 urllib2 会报错。

查看此处了解从 Google 词典获取数据的另一种方式:

http://googlesystem.blogspot.com/2009/12/on-googles-unofficial-dictionary-api.html

【讨论】:

  • 谢谢,还有加星词表的API吗?
  • @user313439:我不确定那是什么。
【解决方案2】:

Google 是否需要 SSL 网址?您使用的是“http://”,但示例脚本使用的是“https://”

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-20
    • 2019-12-03
    • 2016-04-18
    • 2021-06-20
    • 1970-01-01
    • 2021-03-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多