python - tweepy library connects to Twitter API and reports errors
某草草
某草草 2017-05-24 11:35:03
0
1
849

Environment: python 2.7.10 tweepy:3.5.0
Error: tweepy.error.TweepError: Failed to send request: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)

Code: A demo on the Internet
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 tweets in public_tweets:

print num  
num += 1  
text_noem = highpoints.sub('--emoji--', tweet.text)  
text_noem = text_noem.encode('utf8')

Please give me some advice, what’s the reason?

某草草
某草草

reply all(1)
黄舟

It turns out that the proxy server does not support the http protocol. Just change the proxy and it will be fine

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!