文章詳情頁
python - tweepy 庫 連接Twitter API 報錯
瀏覽:159日期: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. css3 - 我想要背景長度變化,而文字不移動,要怎么修改呢2. mysql - 記得以前在哪里看過一個估算時間的網站3. python - 有什么好的可以收集貨幣基金的資源?4. python - 啟動Eric6時報錯:’qscintilla_zh_CN’ could not be loaded5. java - 為什么第一個線程已經釋放了鎖,第二個線程卻不行?6. MySQL中的enum類型有什么優點?7. android下css3動畫非常卡,GPU也不差啊8. css3 - 純css實現點擊特效9. javascript - 關于<a>元素與<input>元素的JS事件運行問題10. html - vue項目中用到了elementUI問題
排行榜
