我正在编写一个脚本,用于查找 Twitter 用户的最后一条推文。
我正在使用 tweepy,我知道有一个有效的答案 Get the last tweet with tweepy
但是它也会打印用户的回复。 我只想拥有一个人发送的实际推文
tweetL = api.user_timeline(screen_name='elonmusk', tweet_mode="extended")
print(tweetL[0].full_text)
我该怎么做,是否有相应的功能?
答案 0 :(得分:1)
您可以向 user_timeline
函数传递一个额外的参数,它称为 exclude_replies
。
请查看 documentation 以了解该函数的所有可能参数。