我是在 python 中使用 pytrends 模块的新手,它允许您从 Google Trends 中提取数据。该站点很好地介绍了该模块:https ://github.com/GeneralMills/pytrends
使用 pytrend.interest_over_time() 时,我收到消息“ValueError:年份超出范围”。我的代码的关键部分是:
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:年份超出范围”