requests
http/https代理设置
import requests
proxy = '120.78.225.5:3128'
proxies = {
'http': 'http://' + proxy,
'https': 'https://' + proxy,
}
try:
response = requests.get('http://httpbin.org/get', proxies=proxies)
print(response.text)
except requests.exceptions.ConnectionError as e:
print('Error', e.args)
# 输出:
{
"args": {
},
"headers": {
"Accept": "*/*",
"Accept-Encoding&#