我是python中pytrends模块的新手,它允许您从googletrends获取数据。这个网站很好地介绍了这个模块:https://github.com/GeneralMills/pytrends
使用时,我收到消息“ValueError:year is out out of range”(值错误:年份超出范围)pytrend.interest_随时间变化(). 我的代码的关键部分是:
import pytrends
from pytrends.request import TrendReq
google_username = "" #my username
google_password = "" #my password
pytrend = TrendReq(google_username, google_password, custom_useragent=None)
pytrend.build_payload(kw_list=['Chipotle'], timeframe = 'today 5-y')
pytrend.interest_over_time()
然后收到错误消息“ValueError:year is outer of range”
我也有同样的问题,我在请求.py在第180行
发件人:
收件人:
^{pr2}$(不知道为什么我的行号不同,但看起来是同一个问题)
在python中更改以下内容…\Lib\site packages\pytrends\请求.py在
第3行:
围绕第128行:
^{pr2}$这对我有用:)
相关问题 更多 >
编程相关推荐