Feedparser.parse() 'SSL: CERTIFICATE_VERIFY_FAILED'

前端 未结 3 1724
忘了有多久
忘了有多久 2020-12-18 22:47

I\'m having this SSL issue with feedparser parsing an HTTPS RSS feed, I don\'t really know what to do as I can\'t find any documentation on this error when it c

3条回答
  •  一个人的身影
    2020-12-18 23:17

    Thanks you cmidi for the answer, which was to 'monkey patch' using ssl._create_default_https_context = ssl._create_unverified_context

    import feedparser
    import ssl
    if hasattr(ssl, '_create_unverified_context'):
        ssl._create_default_https_context = ssl._create_unverified_context
    feed = feedparser.parse(rss) #<

提交回复
热议问题