python-Tweepy是否支持运行多个Streams来收集数据?
作者:互联网
例如,我想收集与三个关键字相关的数据:
>关键字1
>关键字2
>关键字3
我了解我可以使用以下方法一次收集所有信息:set track = [keyword1,keyword2,keyword3].是否可以运行三个不同的Python进程来分别收集这些关键字的数据?
解决方法:
不幸的是no.假设您使用的是Tweepy的Stream类(使用Twitter流API),则无法使用单个帐户建立多个连接.如果您尝试使用多个帐户来规避此问题,还应该注意以下事项:
Each account may create only one standing connection to the public endpoints, and connecting to a public stream more than once with the same account credentials will cause the oldest connection to be disconnected.
Clients which make excessive connection attempts (both successful and unsuccessful) run the risk of having their IP automatically banned.
标签:twitter,streaming,tweepy,python 来源: https://codeday.me/bug/20191029/1956934.html