2017-01-12 6 views
0

私は可能な検索値のリストを反復するTweepy検索からscreen_namesを取得しようとしています。Tweepy:検索結果からscreen_nameを取得しますか?

import tweepy 
positive = 'yes', 'yep', 'yepp' 

yes = 0 
for vote in positive: 
    print(vote) 
    voteYes = api.search(q='{} #waterbecky'.format(vote)) 
    for tweet in voteYes: 
     #extract screen_name here and increase yes by 1 

私の問題は、その検索リストからスクリーンネームを引き出すコードを見つけることです。私は答えを見つけるために全部を探しましたが、私が見つけたものはすべて、まず各ツイートのID値を知ってから、そのIDからscreen_nameを取得します。

答えて

0

JSON tweepyの返品を検索した後、答えがつぶれました。

for votes in positive: 
    votesPos = api.search(q='#waterbecky {}'.format(votes)) 
    for content in votePos: 
     print(content.author._json['screen_name']) 
関連する問題