python - tweepy 庫 連接Twitter API 報錯
問題描述
環(huán)境:python 2.7.10 tweepy:3.5.0錯誤:tweepy.error.TweepError: Failed to send request: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
代碼:網(wǎng)上一個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協(xié)議,換了代理就可以了
相關文章:
1. 淺談vue生命周期共有幾個階段?分別是什么?2. index.php錯誤,求指點3. 視頻 - html5 video的autoplay 在智能手機上不運作?4. javascript - 百度坐標,返回目標附近有哪些坐標5. css3 - 使用less編譯css后,后期的項目中l(wèi)ess是直接放在項目文件中,后期如何維護呢6. css3 - 在css里面,樣式不生效問題7. node.js - 在阿里云搭建vue環(huán)境后npm run dev 沒有看到vue歡迎頁面而是 UnhandledPromiseRejection8. javascript - Jquary的contains如何做到精準匹配9. html5 - 前端面試碰到了一個緩存數(shù)據(jù)的問題,來論壇上請教一下10. javascript - ui-router AngularJS url顯示正常 頁面沒有變化?
