不支持的代理方案[Python3] [请求模块]

时间:2019-06-15 13:23:40

标签: python-3.x proxy python-requests urllib3

我正在尝试制作一些连接到代理的代码,我已经编写了所有代码,但是出现一条错误消息:

urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme 37.59.8.29

我的代码如下:

proxie_list = open(dir_path + "/proxies.txt", 'r').readlines()
print(proxie_list[i])
i = i
proxies = {
    'http': proxie_list[i] ,
    'https': proxie_list[i] ,
}

# Create the session and set the proxies.
s = requests.Session()
s.proxies = proxies

# Make the HTTP request through the session.
r = s.get('http://httpbin.org/ip')

# Check if the proxy was indeed used (the text should contain the proxy IP).
print(r.text)

非常感谢您的帮助!

0 个答案:

没有答案