如何从tweet获取Twitter用户名-PYTHON
我是tweepy的新手,我能够通过以下脚本从twitter获取数据:如何从tweet获取Twitter用户名-PYTHON,python,twitter,tweepy,Python,Twitter,Tweepy,我是tweepy的新手,我能够通过以下脚本从twitter获取数据: import tweepy from tweepy import OAuthHandler access_token="---------" access_token_secret="----------" consumer_key="---------" consumer_secret="-------" auth = OAuthHandler(cons
import tweepy
from tweepy import OAuthHandler
access_token="---------"
access_token_secret="----------"
consumer_key="---------"
consumer_secret="-------"
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
public_tweets = api.home_timeline()
print("public_tweets.text")
现在,您想获取推特用户的用户名以及获取的推特信息吗
例如:
“用户名”:“-----推特-----”
提前谢谢你谢谢你,你救了我一天
public_tweets = api.home_timeline()
for tweet in public_tweets:
print('From :', tweet.user.screen_name, ', Text :', tweet.text)