背景
有个网站开了代理,浏览器可以访问,但是命令行ping不通,telnet不通,python requests请求报上述错误
解决方案
配置代理,改成http请求
url = "http://m.zhibo8.com/news/web/zuqiu/2024-12-02/match1437755date2024vnative.htm" # 替换为实际的网页链接
proxies = {
'http': 'http://127.0.0.1:7890',
# 'https': 'https://127.0.0.1:7890'
}
# 发送请求并获取网页内容
response = requests.get(url, proxies=proxies, verify=False)
参考
This error is related to an issue with SSL while attempting to connect to a server through a proxy. Here’s a breakdown of the problem and possible solutions:
Problem Details
- ProxyError: The application was unable to establish a connection to the proxy server.
- SSLError: The SSL/TLS handshake failed.
- SSLEOFError: The server abruptly closed the connection during the handshake, which is against the SSL protocol.
Common Causes
- Incorrect Proxy Configuration: The proxy settings (URL, port, username/password) might be incorrect.
- Incompatible SSL/TLS Version: The server or proxy might req