如何解决运行 tweepy bihind 代理
我尝试运行 Tweepy Bihind 代理, 但是当我尝试这种方式时,它并没有像看起来那样尝试使用它,并且无论如何都会运行脚本,即使代理已“损坏”。 虽然在 API.py 里面我看到了函数代理句柄。 我什么时候穿,我能做什么? 在 python 3.9 中尝试
import tweepy
import json
import pandas as pd
consumer_key = 'xxBmxxxm'
consumer_secret = 'xxxxxOl'
access_token = 'xxxx0-lxxxxp'
access_token_secret = '8xxxxxxUf'
auth = tweepy.OAuthHandler(consumer_key,consumer_secret)
auth.set_access_token(access_token,access_token_secret)
##api = tw.API(auth,wait_on_rate_limit=True)
api = tweepy.API(auth,proxy = "vxxi-dexxxxst:vvxxxxn1@45.1945545.354.25450:6549")
class MyStreamListener(tweepy.StreamListener):
def on_status(self,status):
print("DSdsds")
def on_error(self,status_code):
if status_code == 420:
#returning False in on_data disconnects the stream
return False
myStreamListener = MyStreamListener()
myStream = tweepy.Stream(auth=api.auth,listener=myStreamListener)
myStream.filter(track="Trump")
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。