Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/304.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 HTTPSConnectionPool错误_Python_Web Scraping_Httpconnection - Fatal编程技术网

Python HTTPSConnectionPool错误

Python HTTPSConnectionPool错误,python,web-scraping,httpconnection,Python,Web Scraping,Httpconnection,我正在尝试使用Python 3.x从特定网站上刮取数据,对于某些网站,它不允许我刮取数据,它显示了如下错误: raise ConnectionError(e,请求=请求) requests.exceptions.ConnectionError:HTTPSConnectionPool(主机=“…”,端口=443):url:/(由NewConnectionError引起)(“:无法建立新连接:[WinError 10060] 电子邮件验证也经常发生这种情况。我想知道如何处理此类错误以及解决方案是什么

我正在尝试使用Python 3.x从特定网站上刮取数据,对于某些网站,它不允许我刮取数据,它显示了如下错误:

raise ConnectionError(e,请求=请求) requests.exceptions.ConnectionError:HTTPSConnectionPool(主机=“…”,端口=443):url:/(由NewConnectionError引起)(“:无法建立新连接:[WinError 10060]

电子邮件验证也经常发生这种情况。我想知道如何处理此类错误以及解决方案是什么

谢谢你抽出时间

p.S.代码如下:

enrich_url = "..."

ua = UserAgent()
header = {'user-agent':ua.chrome}
website = requests.get(enrich_url, headers=header) <--- (error is showing here)

soup = BeautifulSoup(website.content, 'html.parser')
enrich_url=“…”
ua=UserAgent()
header={'user-agent':ua.chrome}

website=requests.get(enrich_url,headers=header)发布引发此错误的代码。它不工作的网站用显示错误的部分更新了问题:-)