Request.urlopen證書問題:SSL: CERTIFICATE_VERIFY_FAILED

方案1.web

import ssl
import urllib2
context = ssl._create_unverified_context()
print urllib2.urlopen("https://www.12306.cn/mormhweb/", context=context).read()url

 

方案2:spa

import ssl
import urllib2
ssl._create_default_https_context = ssl._create_unverified_context
print urllib2.urlopen("https://www.12306.cn/mormhweb/").read().net

 

ps:https://blog.csdn.net/sylmoon/article/details/78777770orm

https://blog.csdn.net/xiaopangxia/article/details/49908889blog

相關文章
相關標籤/搜索