【问题标题】:HTTPS Link using urllib.urlretrieve in Python在 Python 中使用 urllib.urlretrieve 的 HTTPS 链接
【发布时间】:2020-04-04 23:47:22
【问题描述】:

我正在使用此代码,它在使用 HTTP 时运行良好,但在通过 HTTPS 连接时无法运行

import urllib
import ssl
(fn,hd) = urllib.urlretrieve('http://host.com/file.py')
execfile(fn)

有人知道如何使用相同的代码连接到 HTTPS 吗?

感谢大家的帮助。

【问题讨论】:

    标签: python urllib urlretrieve


    【解决方案1】:

    尝试将 http 替换为 https。

    关于这个主题的答案几乎涵盖了它:How to know if urllib.urlretrieve succeeds?

    【讨论】:

      猜你喜欢
      • 2015-09-14
      • 1970-01-01
      • 1970-01-01
      • 2014-02-05
      • 2012-11-01
      • 2016-11-16
      • 1970-01-01
      • 2014-08-06
      • 1970-01-01
      相关资源
      最近更新 更多