如何读取网址并在python中检查HTTPS?

问题描述 投票:0回答:1

如何在python中读取URL并检查HTTPS?

import urllib2
response = urllib2.urlopen('https://www.google.com/')
html = response.read()
python python-3.x numpy security https
1个回答
0
投票

尝试以下操作:

import urllib.request

response = urllib.request.urlopen('https://www.google.com/')
html = response.read()
print(html)

即使给出错误,也请尝试安装以下内容,然后重试上述代码:

pip install urllib3
© www.soinside.com 2019 - 2024. All rights reserved.