文章詳情頁
python - tweepy 庫 連接Twitter API 報錯
瀏覽:105日期: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. docker網絡端口映射,沒有方便點的操作方法么?2. docker gitlab 如何git clone?3. debian - docker依賴的aufs-tools源碼哪里可以找到啊?4. angular.js使用$resource服務把數據存入mongodb的問題。5. macos - mac下docker如何設置代理6. html - 對瀏覽器縮放然后大圖也縮放的問題。7. docker start -a dockername 老是卡住,什么情況?8. Docker for Mac 創建的dnsmasq容器連不上/不工作的問題9. docker鏡像push報錯10. dockerfile - [docker build image失敗- npm install]
排行榜
