文章詳情頁
python - tweepy 庫 連接Twitter API 報錯
瀏覽:236日期: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. golang - 用IDE看docker源碼時的小問題2. docker images顯示的鏡像過多,狗眼被亮瞎了,怎么辦?3. html - css氣泡,實現“倒三角(不知道算不算三角了)”可透明的。4. 前端 - @media query 使用出現的問題?5. phpstudy8.1沒集成mysql-front6. 運行python程序時出現“應用程序發生異常”的內存錯誤?7. docker - 如何修改運行中容器的配置8. html5和Flash對抗是什么情況?9. 我何時應該在Java中使用JFrame.add(component)和JFrame.getContentPane()。add(component)10. 利用IPMI遠程安裝centos報錯!
排行榜

網公網安備