python requests 使用代理池访问https站点返回乱码

问题表现:

  • 检查一下正常的请求头里面accept-encoding字段是否包含br,如果包含,果断pip install urllib3[brotli],详见ssl-warnings

记录另外一个问题:

  • 若错误中含Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:835: The handshake operation timed out',并且试用了代理,请降低requests版本:pip install requests==2.23.0

再记录一个: [SSL: UNKNOWN_PROTOCOL]

  • pip install requests[security]
posted @ 2021-04-16 15:58  秒年度  阅读(746)  评论(0编辑  收藏  举报