如何在tweepy中提取创建api.search返回的tweet的用户?

2024-05-20 23:39:51 发布

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

我正在尝试搜索包含指定标签的tweet,然后获取创建tweet的用户

import tweepy

tweets = tweepy.Cursor(api.search, q="python", tweet_mode='extended').items()

while True:
    tweet = next(tweets)
    for hashtag in tweet.entities.get('hashtags'):
        ht = hashtag['text']
        # process the hashtag...

    # who is the user that created this tweet?
    user = ???

如何从tweet对象中提取用户


Tags: the用户importapiextendedsearchmodeitems