2017-02-18 75 views
0

我一直在使用Tweepy一段時間。我能夠獲得一個句柄的追隨者人數,並且他們的句柄名也是如此,但不包括以下數字。我正在使用python3和tweepy。 任何人都可以幫我解決這個問題嗎?如何使用tweepy獲取任何Twitter帳戶的關注

預先感謝

回答

0

嘗試usr.friends_count,其中usr是tweepy User對象。一個工作示例:

pub_tweets = api.home_timeline() 
for tweet in pub_tweets: 
    print(tweet.author.friends_count) 

有關Twitter用戶對象中可用的其他信息,請參見https://dev.twitter.com/overview/api/users

+0

感謝您的快速響應。 你還可以讓我知道如何獲得那些以下的句柄名稱嗎? – panga30

+0

您需要使用http://tweepy.readthedocs.io/en/v3.5.0/api.html#API.friends_ids遍歷所有頁面,然後爲每個id檢索用戶對象。 –

相關問題