環境:python 2.7.10 tweepy:3.5.0
錯誤:tweepy.error.TweepError: Failed to send request: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
程式碼:網路上一個demo
import re
import 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')
求大神指點,什麼原因呢?