使用Python 1.6.1时访问谷歌搜索页面时出错

2024-04-26 22:17:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用Python的库google1.6.1(https://breakingcode.wordpress.com/2010/06/29/google-search-python/)在google中搜索。在

代码运行了4到5次,但之后我开始收到以下错误消息:

“访问时出错:http://www.google.com/search?q=”。在

这是代码失败的函数:

def search(query):
    global coincidence
    search_results = google.search(query, num_page)
    for result in search_results:
         if word in result.link:
              coincidences.append(result.link)

有什么建议吗?在

谢谢大家。在


Tags: inhttpscomhttp消息search错误google