python - 让requests不走系统 全局 代理
PHPz
PHPz 2017-04-18 09:50:30
0
1
867

做的是wifi自动验证登录脚本。

用的是Python的requests库。

File "/home/c/.local/lib/python2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/home/c/.local/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/c/.local/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/c/.local/lib/python2.7/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/home/c/.local/lib/python2.7/site-packages/requests/adapters.py", line 485, in send
    raise ProxyError(e, request=request)


requests.exceptions.ProxyError: 
HTTPConnectionPool(host='127.0.0.1', port=1080): 
Max retries exceeded with url: 
http://www.baidu.com/ 
(Caused by ProxyError('Cannot connect to proxy.', NewConnectionError(
'<requests.packages.urllib3.connection.HTTPConnection object at 0x7fb9fb043810>: 
Failed to establish a new connection: [Errno 111] Connection refused',))
)

在当挂了代理后无法正常跳转(代理可用没坏),必须关闭代理才可以使用脚本,很不方便。

希望做到就是像firefox代理配置里那样可以直接连网络免疫系统代理。

求大佬指点一下……

PHPz
PHPz

学习是最好的投资!

全部回复(1)
Ty80

Stackoverflow中已解决

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板