如何在python中读取URL并检查HTTPS?
import urllib2
response = urllib2.urlopen('https://www.google.com/')
html = response.read()
尝试以下操作:
import urllib.request
response = urllib.request.urlopen('https://www.google.com/')
html = response.read()
print(html)
即使给出错误,也请尝试安装以下内容,然后重试上述代码:
pip install urllib3