Tweepy的搜索过滤器允许在字符串中搜索子字符串吗?

4
如果我当前搜索的是 tweepy.Cursor(api.search, [obama]),这会返回只包含hashtag #obama但不含obama的推文吗?
我的问题是api.search是否会返回具有包含搜索词组的字符串作为子字符串的推文?
例如: tweepy.Cursor(api.search, [obama]) 返回以下推文: 史上最伟大的总统!#obama
1个回答

1
如果您想获取以 # 开头的推文,您需要使用 #obama。
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…

我明白了,所以没有办法搜索子字符串吗? - chadlei
这根本不是一个有效的结论。 - tripleee

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接