我有一个Python脚本来解析twitter,它在tweepy的旧版本中运行得非常好:
consumer_key = '+++'
consumer_secret = '+++'
access_key = '+++'
access_secret = ''+++'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
json_user_timeline = tweepy.binder.bind_api(
path = '/statuses/user_timeline.json',
payload_type = 'json', payload_list = True,
allowed_param = ['id', 'user_id', 'screen_name', 'since_id', 'max_id', 'count', 'page', 'include_rts'])
d={}
a=[]
h = HTMLParser.HTMLParser()
for tweet in tweepy.Cursor(json_user_timeline, api, screen_name='++user_name++', count=200, include_rts=True).items(200):
.........
.........
现在我已经升级到tweepy 2.3,错误如下:
allowed_param = ['id', 'user_id', 'screen_name', 'since_id', 'max_id', 'count', 'page', 'include_rts'])
File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 21, in bind_api
File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 23, in APIMethod
KeyError: 'api'
为什么?你知道吗
多谢了
目前没有回答
相关问题 更多 >
编程相关推荐