Pytrends:请求失败:Google返回了一个响应,代码为429

2024-04-29 13:57:57 发布

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

我正在使用Pytrends提取Google趋势数据,比如:

from pytrends.request import TrendReq
pytrend = TrendReq()
pytrend.build_payload(kw_list=['bitcoin'], cat=0, timeframe=from_date+' '+today_date)

它返回一个错误:

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

我昨天做的,但不知为什么现在不行了!来自github的源代码也失败:

pytrends = TrendReq(hl='en-US', tz=360, proxies = {'https': 'https://34.203.233.13:80'})

我该怎么解决?谢谢!


Tags: 数据fromhttpsimportbuilddaterequestgoogle