Python-Pytrends ResponseError代码400429

时间:2018-10-16 19:56:53

标签: python request response google-trends

我不断遇到Pytends错误,这使我无法从Google趋势中获取关键字的数据。

我看到了类似的问题,但是代码错误是429。 Pytrends: The request failed: Google returned a response with code 429

我的代码:

import pytrends
from pytrends.request import TrendReq
password = "***********" ; email = "********@gmail.com"
pytrend = TrendReq(email, password)

# WORKS FINE ABOVE, ERROR OCCURS WITH THIS LINE OF CODE BELOW
pytrends.build_payload(kw_list=["Python", "Java"], geo="US")

错误:

 ResponseError: The request failed: Google returned a response with code 400.

一年多以前,我就与pytrend一起工作过,并且效果很好。所以我有点困惑。任何帮助将不胜感激。

我正在使用Pytrends的最新版本4.4.0

1 个答案:

答案 0 :(得分:0)

您定义了pytrend(不带s),并尝试使用pytrends(带s)