如果我当前正在搜索tweepy.Cursor(api.search, [obama]),是否会返回仅包含标签#obama而不包含obama的tweets?
我想问的是api.search是否会返回包含搜索项作为子字符串的字符串的tweets?
我想要的例子:
tweepy.Cursor(api.search, [obama])返回一条tweet,例如:
史上最伟大的总统!#奥巴马

最佳答案

如果你想从#

tweets = tweepy.Cursor(api.search, ["#obama"]).items(4)
    for tweet in tweets:
        print(tweet.text)

输出:
RT @afbranco: A.F. Branco Cartoon - Yes We Cage  #KidsInCages #Obama #Obamacages #BorderCrisis
BEHIND THE COMFORT WOMEN CONTROVERSY: HOW LIES BECAME TRUTH / N.Tsutomu #Obama #Clinton #Bush #GOP
RT @christinagala17: @davidaxelrod Can't defend the indefensible.  There was NOT a #MüellerInvestigation. He hired ONE lawyer, you know, yo…
RT @LongDefense: These appear to be the last minute changes made by #Obama Admin days before #Trump took office loosening dissemination of…

09-30 10:02