urllib cannot read https

后端 未结 4 662
温柔的废话
温柔的废话 2020-12-10 05:35

(Python 3.4.2) Would anyone be able to help me fetch https pages with urllib? I\'ve spent hours trying to figure this out.

Here\'s what I\'m trying to do (pretty bas

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 05:53

    Double check your compilation options, looks like something is wrong with your box.

    At least the following code works for me:

    from urllib.request import urlopen
    resp = urlopen('https://github.com')
    print(resp.read())
    

提交回复
热议问题