文章详情页
python - tweepy 库 连接Twitter API 报错
浏览:268日期:2022-06-30 13:15:38
问题描述
环境:python 2.7.10 tweepy:3.5.0错误:tweepy.error.TweepError: Failed to send request: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
代码:网上一个demoimport reimport tweepy
auth = tweepy.OAuthHandler('xxxxx',
'xxxxx')
auth.set_access_token('xxxxx',
'xxxxx')
api = tweepy.API(auth,proxy='127.0.0.1:1080') highpoints = re.compile(u’uD800-uDBFF’) public_tweets = api.home_timeline() num = 0 for tweet in public_tweets:
print num num += 1 text_noem = highpoints.sub(’--emoji--’, tweet.text) text_noem = text_noem.encode(’utf8’)
求大神指点,什么原因呢?
问题解答
回答1:原来是代理服务器不支持http协议,换了代理就可以了
相关文章:
1. docker网络端口映射,没有方便点的操作方法么?2. docker api 开发的端口怎么获取?3. 前端 - 类到底该如何去命名 .newsList 这种的命名难道真的不是过度语义化吗?~4. golang - 用IDE看docker源码时的小问题5. Docker for Mac 创建的dnsmasq容器连不上/不工作的问题6. docker容器呢SSH为什么连不通呢?7. 如何解决Centos下Docker服务启动无响应,且输入docker命令无响应?8. docker images显示的镜像过多,狗眼被亮瞎了,怎么办?9. docker gitlab 如何git clone?10. docker不显示端口映射呢?
排行榜

网公网安备