【发布时间】:2021-11-23 18:10:36
【问题描述】:
class MyStreamListener(tweepy.StreamListener):
def on_status(self, status):
print(status.text) # prints every tweet received
def on_error(self, status_code):
if status_code == 420: # end of monthly limit rate (500k)
return False
我使用 Python 3.9 并通过 pip 安装了 Tweepy。我在课堂上得到AttributeError。
我的导入只是import tweepy。身份验证得到正确处理。
在streaming.py 文件中,我有类Stream。但是使用这个类就结束了。例如没有status.text,即使有on_status 函数。我有点困惑。
【问题讨论】:
-
他们没有更新文档我不知道为什么!我也和你一样落入陷阱。
标签: python twitter attributes tweepy