使用python requests模块调用vmallarg.vmall.com接口API时报如下错误:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='vmallrag.vmall.com', port=443): Max retries exceeded with url: .... (Caused by New ConnectionError('ect at 0x01C3DA10>: Failed to establish a new connection: [Errno 10060] ',))
 
测试场景:
  在postman中调用时可以成功返回,在浏览器中也可以成功访问该网址。
 
然而在dos下telnet连接失败:

这是为什么呢?原来在公司内网设置了浏览器代理服务器,想访问外部网址必须经过代理服务器才能访问,公司代理服务器地址:xx.aa.com 端口:8080(这个代理在IE设置局域网中可以看到)

所以在requests中设置对应的代理就能连接正常了,代理设置如下:

  https的请求代理:proxy = {"https":"xx.aa.com:8080"},http的请求代理: proxy = {"http":"xx.aa.com:8080"},或者http/https的一并设置:proxy={"https":"xx.aa.com:8080","http":"xx.aa.com:8080"}

然后在requests的get、post方法中指定如下:
  requests.get(url, proxies=proxy)
  requests.post(url, proxies=proxy)

 

 
 
 

requests 处理异常错误 requests.exceptions.ConnectionError HTTPSConnectionPool [Errno 10060]的更多相关文章

  1. 关于requests.exceptions.ConnectionError: HTTPSConnectionPool的问题

    错误如下: raise ConnectionError(e, request=request)requests.exceptions.ConnectionError: HTTPSConnectionP ...

  2. 工作问题--------爬虫遇到requests.exceptions.ConnectionError: HTTPSConnectionPool Max retries exceeded

    问题描述:爬取京东的网站,爬取一段时间后报错. 经过一番查询,发现该错误是因为如下: http的连接数超过最大限制,默认的情况下连接是Keep-alive的,所以这就导致了服务器保持了太多连接而不能再 ...

  3. 安装SpaCy出现报错:requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443):

    内含安装步骤及报错解决:https://www.cnblogs.com/xiaolan-Lin/p/13286885.html

  4. python使用requests时报错requests.exceptions.SSLError: HTTPSConnectionPool

    报错信息 Traceback (most recent call last): File "<stdin>", line 1, in <module> Fi ...

  5. python requests.exceptions.ConnectionError

    今天遇到一个奇葩问题, 1.r.request.post(url) 2..print r. status_code 居然第一步就报错了,原因是url不正确,按道理应该可以走到第二步然后输入404的 i ...

  6. 关于requests.exceptions.SSLError: HTTPSConnectionPool

    问题: requests.exceptions.SSLError: HTTPSConnectionPool(host='mall.christine.com.cn', port=443): Max r ...

  7. 【Mac + ATX基于uiautomator2】使用weditor时,报错:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

    产生以下原因找到了:是因为启动了appium,两者冲突,不能同时使用. 之前讲过怎么安装u2([Mac安装,ATX基于uiautomator2]之安装步骤)以及使用weditor, 但是经过一段时间, ...

  8. 【airtest, python】报错:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')),解决方法如下

    环境及设备 mac, xcode , iphonex 问题 最近出现一个让人费解的问题,airtest 没跑多长时间,服务就断掉,而且总是报“requests.exceptions.Connectio ...

  9. 【airtest】报错:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')),解决方法如下

    1. 环境及设备:mac, xcode , iphonex 2. 最近出现一个让人费解的问题,airtest 没跑多长时间,服务就断掉,而且总是报“requests.exceptions.Connec ...

随机推荐

  1. 腾讯开源项目phxpaxos的编译步骤

    #paxos的一般编译流程在项目文档<中文详细编译手册>里面已经有介绍,这里重点介绍一下编译samples目录下的代码: #我的环境是ubuntu; #设置paxos根目录 phx_dir ...

  2. mysql too many connection 解决

    最近的项目用了动态切换数据源起初感觉还好,后来发现每次切换数据库都会创建一个新的连接,这样就导致大量的sleep线程.而mysql的默认sleep时间是28800秒....默认最大连接数为151,这就 ...

  3. Centos 7 下安装 Docker

    docker目前只支持Centos 7及以后的版本,系统要求:64位,内核版本至少在3.10及以后版本.       第一步:     添加软件源,安装依赖软件包以方便对devicemapper存储的 ...

  4. Leetcode——Two Sum(easy)

    题目:Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1] 代码: ...

  5. 使用双引擎,让kbmmw 的客户端访问更方便

    前面我们一直都讲了如何使用kbmmw smarthttpservice 给客户端提供REST  服务.主要都是返回给 浏览器访问的,如果我们使用delphi 开发桌面应用,如何使用这些服务呢?其实一切 ...

  6. Notes on Operating System

  7. HDU 6377 度度熊看球赛 (计数DP)

    度度熊看球赛 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Subm ...

  8. 无网 离线状态下pip3安装 django等软件

    https://stackoverflow.com/questions/7300321/how-to-use-pythons-pip-to-download-and-keep-the-zipped-f ...

  9. spring InitializingBean和DisposableBean init-method 和destroy-method @PostConstruct @PreDestroy

    对于初始化函数: @PostConstruct 注解的方法 InitializingBean接口定义的回调afterPropertiesSet() Bean配置中自定义的初始化函数 对于析构则与上相同 ...

  10. DOM函数和jQuery函数的覆盖与执行顺序

    <script type="text/javascript"> window.onload = function () { alert(); } window.onlo ...