Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何过滤字符之间为空的twitter?_Python_Nlp_Web Crawler_Tweepy_Twitter Streaming Api - Fatal编程技术网

Python 如何过滤字符之间为空的twitter?

Python 如何过滤字符之间为空的twitter?,python,nlp,web-crawler,tweepy,twitter-streaming-api,Python,Nlp,Web Crawler,Tweepy,Twitter Streaming Api,基于twitter流媒体api和tweepy,我想过滤twitter帖子中包含的内容 代码如下的“A B”: twitter_stream.filter(track=['A B']) 但结果却出乎意料: A New Project Featuring ASAP Rocky Vince Staples Lil B In a contract, A & B agree to do various 但我想匹配的内容如下: A B want to .... ...xx A B xx

基于twitter流媒体api和tweepy,我想过滤twitter帖子中包含的内容 代码如下的“A B”:

twitter_stream.filter(track=['A B'])
但结果却出乎意料:

A New Project Featuring ASAP Rocky Vince Staples Lil B
In a contract, A & B agree to do various
但我想匹配的内容如下:

A B want to .... 
...xx A B xx...
有人有这样的经历吗

将空间编码为“%20”

twitter_stream.filter(track=['A%20B'])
您可以自己编写一个函数来验证推文。