简体   繁体   English

如何使用仅包含方括号或符号的tweepy搜索查询

[英]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. 我正在尝试使用tweepy搜索仅包含方括号或符号的推文。

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}] tweepy.error.TweepError:[{u'message':u'缺少或无效的url参数。',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". 我使用其他库来做到这一点( https://github.com/Jefferson-Henrique/GetOldTweets-python ),我可以在其中键入q =“ this或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. 但是您也可能会遇到问题,因为Twitter搜索将尝试忽略井号,标点符号,@等字符。祝您好运,希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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