Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在python 3.7中尝试使用requests.get时出现新的连接错误_Python_Get_Request_Connection - Fatal编程技术网

在python 3.7中尝试使用requests.get时出现新的连接错误

在python 3.7中尝试使用requests.get时出现新的连接错误,python,get,request,connection,Python,Get,Request,Connection,我一直在尝试直接从URL下载一个文件,问题是,当我在家里下载时,效果非常好,但当我尝试在我公司的服务器上运行时,它就不起作用了 我的代码是: import requests url = "https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php" response = requests.get(url, verify=False) url = op

我一直在尝试直接从URL下载一个文件,问题是,当我在家里下载时,效果非常好,但当我尝试在我公司的服务器上运行时,它就不起作用了

我的代码是:

import requests

url = "https://servicos.ibama.gov.br/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php"

response = requests.get(url, verify=False)

url = open("teste.zip", "w")
url.write(response.content)
url.close()
我得到的错误信息是:

HTTPSConnectionPool(host='servicos.ibama.gov.br',port=443):url:/ctf/publico/areasembargadas/downloadListaAreasEmbargadas.php超过最大重试次数(由NewConnectionError引起(':未能建立新连接:[Errno 11001]getaddrinfo Failed'))


我知道我们在这里使用代理,我一直在寻找这个问题的解决方案,我可以看出这是相关的,但我找不到与此相关的信息

有任何解决方案吗