文章詳情頁
python - tweepy 庫 連接Twitter API 報錯
瀏覽:119日期: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. vue ajax請求回來的數據沒有渲染到頁面2. javascript - node.js中stat() access() open() readFile()都能判斷文件是否存在?3. mysql - 分庫分表、分區、讀寫分離 這些都是用在什么場景下 ,會帶來哪些效率或者其他方面的好處4. 一個mysql聯表查詢的問題5. html的qq快捷登錄怎么搞?求個源碼6. 編程小白 問關于python當中類的方法的參數問題7. python中def定義的函數加括號和不加括號的區別?8. mysql 能不能創建一個 有列級函數 的聯合視圖?9. mysql - select查詢多個紀錄的條件怎么寫10. mysql - 求SQL語句:查詢某個值介于兩個字段值之間的記錄。
排行榜
