我正在尝试从Internet档案中下载文件,并出现以下错误:
SSLError:HTTPSConnectionPool(host ='ia800809.us.archive.org', port = 443):网址超过了最大重试次数: /9/items/issuu_7days_010803-vol.8-no.20/issuu_7days_010803-vol.8-no.20.pdf (由SSLError(SSLError(“错误的握手:SysCallError(54, 'ECONNRESET')“,),))
相关的代码位是:
url = 'https://archive.org/download/issuu_7days_010803-vol.8-no.20/issuu_7days_010803-vol.8-no.20.pdf'
r = requests.get(url, allow_redirects=True) # to get content after redirection
pdf_url = r.url # 'https://media.readthedocs.org/pdf/django/latest/django.pdf'
with open('/Users/skazi/Downloads/file_name.pdf', 'wb') as f:
f.write(r.content)
我尝试通过自制软件和pip更新openssl,但是那里没有运气。但是,如果我在浏览器中导航到该页面,则一切都变糟了。解决方案?