python - tweepy 庫 連接Twitter API 報(bào)錯
問題描述
環(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’)
求大神指點(diǎn),什么原因呢?
問題解答
回答1:原來是代理服務(wù)器不支持http協(xié)議,換了代理就可以了
相關(guān)文章:
1. docker gitlab 如何git clone?2. 關(guān)于docker下的nginx壓力測試3. 在windows下安裝docker Toolbox 啟動Docker Quickstart Terminal 失敗!4. docker鏡像push報(bào)錯5. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問題。6. mysql - 用PHPEXCEL將excel文件導(dǎo)入數(shù)據(jù)庫數(shù)據(jù)5000+條,本地?cái)?shù)據(jù)庫正常,線上只導(dǎo)入15條,沒有報(bào)錯,哪里的問題?7. PC 手機(jī)兼容的 編輯器8. angular.js - angularJs ngRoute怎么在路由傳遞空字符串及用ng-switch取得9. docker不顯示端口映射呢?10. docker-compose中volumes的問題
