简体   繁体   中英

How to use tweepy search query containing only brackets or signs

I am trying to use tweepy to search for tweets containing only brackets or signs.

The command is:

tweets = auth.search(q="[@", count=100)

But I get the following error:

tweepy.error.TweepError: [{u'message': u'Missing or invalid url parameter.', u'code': 195}]

Any ideas on how to search it correctly? I tried \\\\\\\\[\\\\\\@ and \\\\[\\@ also didn't work.

If you want tweets containing only brackets OR signs, I believe you have to put an additional argument. I use a different library to do it ( https://github.com/Jefferson-Henrique/GetOldTweets-python ) where I can just type q="this or that". But you also may run into issues because the twitter search will try to ignore characters like hashtag, punctuation, @, etc. Good luck, hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM