python - tweepy 庫(kù) 連接Twitter API 報(bào)錯(cuò)
問(wèn)題描述
環(huán)境:python 2.7.10 tweepy:3.5.0錯(cuò)誤:tweepy.error.TweepError: Failed to send request: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
代碼:網(wǎng)上一個(gè)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’)
求大神指點(diǎn),什么原因呢?
問(wèn)題解答
回答1:原來(lái)是代理服務(wù)器不支持http協(xié)議,換了代理就可以了
相關(guān)文章:
1. mysql建表報(bào)錯(cuò),查手冊(cè)看不懂,求解?2. 求大神支招,php怎么操作在一個(gè)html文件的<head>標(biāo)記內(nèi)添加內(nèi)容?3. 致命錯(cuò)誤: Class ’appfacadeTest’ not found4. PHP類屬性聲明?5. php點(diǎn)贊一天一次怎么實(shí)現(xiàn)6. 怎么php怎么通過(guò)數(shù)組顯示sql查詢結(jié)果呢,查詢結(jié)果有多條,如圖。7. 在應(yīng)用配置文件 app.php 中找不到’route_check_cache’配置項(xiàng)8. 老師們php,插入數(shù)據(jù)庫(kù)mysql,都是空的,要怎么解決9. sql語(yǔ)句 - 如何在mysql中批量添加用戶?10. phpstady在win10上運(yùn)行
