使用Luminati代理管理器时发生ProxyError

2024-06-16 12:56:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前正在尝试使用代理刮一个网站。我选择使用Luminati作为代理提供程序。 我使用共享IP创建了一个带有数据中心的区域。 Luminati Dashboard

然后我在本地机器上安装了Luminati代理管理器,使用默认配置设置代理端口

import requests
ip_json =  requests.get('http://lumtest.com/myip.json', proxies={"http":"http://localhost:24000/",
                                                     "https":"http://localhost:24000/"}).json()
proxy = "https://" + ip_json['ip'] + ':' + str(ip_json['asn']['asnum'])
proxies ={"https": proxy , "http": proxy }

headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}


response = requests.get('http://google.com/', headers=headers, proxies=proxies)

然而,每次我

ProxyError: HTTPSConnectionPool(host='x.x.x.x', port=x): Max retries exceeded with url: http://google.com/ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x11d3b5358>: Failed to establish a new connection: [Errno 61] Connection refused',)))

我尝试将URL与http和https结合使用,但没有任何改变。我尝试将代理地址设置为https,但仍然没有

是否有人遇到此错误并解决了它?我非常感谢你的帮助。 多谢各位


Tags: httpsipcomjsonlocalhosthttp代理get
1条回答
网友
1楼 · 发布于 2024-06-16 12:56:12

首先,默认情况下Luminati会阻止google,并且只允许使用SERP区域的特定用例

第二,谷歌是你唯一的目标领域吗?请尝试lumtest.io/myip.json

代理管理器应该在日志中显示错误代码,是否有任何线索

尝试从控制面板联系Luminati live chat支持,您的帐户可能有限制

相关问题 更多 >