【发布时间】:2009-09-21 07:35:48
【问题描述】:
从 Python 中,我想通过带有基本身份验证的 HTTPS 从网站检索内容。我需要磁盘上的内容。我在 Intranet 上,信任 HTTPS 服务器。平台是 Windows 上的 Python 2.6.2。
我一直在玩 urllib2,但是到目前为止没有成功。
我正在运行一个解决方案,通过 os.system() 调用 wget:
wget_cmd = r'\path\to\wget.exe -q -e "https_proxy = http://fqdn.to.proxy:port" --no-check-certificate --http-user="username" --http-password="password" -O path\to\output https://fqdn.to.site/content'
我想摆脱 os.system()。这在 Python 中可行吗?
【问题讨论】:
标签: python proxy https basic-authentication