是否可以使用tweepy python库获取某条推文的转发数?我想获取从特定Twitter帐户发布的每条推文的转发数。是否有任何使用tweepy的python方法?我试过使用beautifulsoup。但是我很难为每条推文获取计数。它仅返回定义的tweet ID的值。那么,如何更改此代码以从该Twitter帐户获取每个已发布推文的值?
id=[[tweet.id]for tweet in alltweets]
html = requests.get("https://twitter.com/%s/status/%s" % ("usename","userID"))
soup = BeautifulSoup(html.text,'lxml')
comments = soup.find_all('span',attrs={'class': 'ProfileTweet-actionCountForAria'})[0].contents
outtweets = [{'ID': tweet.id_str,'Text': tweet.text,'Date': tweet.created_at,'author': tweet.user.screen_name,'retweet-count': tweet.retweet_count,'favourites-count': tweet.favorite_count,'language': tweet.lang,'reply-count': comments}for tweet in alltweets]