certificate verify failed: unable to get local issuer certificate

前端 未结 10 1301
梦如初夏
梦如初夏 2020-11-29 04:06

I am trying to get data from the web using python. I imported urllib.request package for it but while executing, I get error:

certificate verify failed: unab         


        
10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 05:06

    Paste the following code at the start:

    # paste this at the start of code
    import ssl 
    
    try:
        _create_unverified_https_context = ssl._create_unverified_context
    except AttributeError:
        pass
    else:
        ssl._create_default_https_context = _create_unverified_https_context
    

提交回复
热议问题