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. boot2docker無法啟動2. docker-compose中volumes的問題3. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””4. nignx - docker內(nèi)nginx 80端口被占用5. docker容器呢SSH為什么連不通呢?6. 關于docker下的nginx壓力測試7. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.8. node.js - antdesign怎么集合react-redux對input控件進行初始化賦值9. java - SSH框架中寫分頁時service層中不能注入分頁類10. dockerfile - 為什么docker容器啟動不了?

網(wǎng)公網(wǎng)安備