如何使用非官方的Google趋势API(pyGTrends.py)

2024-10-16 20:45:44 发布

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

我开始学习python来制作一个用于抓取web数据的程序。所以我在google上找到了google trend API,pyGTrend.py。但我不能用它。 我可以在谷歌上找到同样的问题,但没有我能理解的解决方案。 请帮帮我。

我刚刚使用了API所有者网站上编写的API:Programmatic Google Trends Api

from pyGTrends import pyGTrends

connector = pyGTrends('googleID','passwaord')
connector.download_report(('banana', 'bread', 'bakery'),date='2008-4',geo='AT',scale=1)
print connector.csv()

错误信息如下

Traceback(most recent call last):
File ('Stdin') line1, in <Module>
File "C:\Pyhon27\Lib\site-pacakage\pyGTrends.py" line 115, in csv
KeyError: 'main'

Tags: csv数据inpy程序apiwebconnector