Python 使用特定用户的标签过滤推文

Python 使用特定用户的标签过滤推文,python,python-3.x,twitter,tweepy,tweets,Python,Python 3.x,Twitter,Tweepy,Tweets,我想过滤特定用户的推文,这些用户有特定的标签。我正在使用Tweepy包和Python 这是我的密码: tt=tweepy.Cursor(api.user_timeline, q='#eko_kendimenotlar', id=42209639, page=1, count=10, tweet_mode='extended').items() for i in tt: print(i.full_text) 但是我从用户那里得

我想过滤特定用户的推文,这些用户有特定的标签。我正在使用Tweepy包和Python

这是我的密码:

tt=tweepy.Cursor(api.user_timeline,
      q='#eko_kendimenotlar',
      id=42209639,
      page=1,
      count=10,
      tweet_mode='extended').items()

for i in tt:
    print(i.full_text)
但是我从用户那里得到了所有推文,而不是通过标签过滤的推文。

该/不接受
q
参数

你必须自己过滤它们。你可以在每条推文的文本中检查标签

另一种方法是使用的
entities
属性,该属性包含
hashtags
字段,这些字段是表示从Tweet文本解析的hashtags的数组

或者,您可以使用/和
from: