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. mysql - 數(shù)據(jù)庫為什么需要鎖機(jī)制?2. npm鏡像站全新上線3. javascript - vue-router怎么不能實(shí)現(xiàn)跳轉(zhuǎn)呢4. python - 模擬滑動驗(yàn)證碼,有源碼,求解5. java - 安卓電視盒子取得了root權(quán)限但是不能安裝第三方應(yīng)用,請問該怎么辦?6. 老哥們求助啊7. 在MySQL中新增字段時,報(bào)錯??8. css3 - 請問一下在移動端CSS布局布局中通常需要用到哪些元素,屬性?9. html5 - angularjs中外部模版加載無法使用10. 我的Apache卡在這里不動了怎么辦?
