形式一
python
import requests
proxies = {'http':'128.3.74.224:2890','https':'128.3.74.224:2890'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)
形式二
形式一不行的情况下,试试形式二
python
import requests
proxies = {'http':'http://127.0.0.1:7890','https':'https://127.0.0.1:7890'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)
形式三
带有账号密码的使用方法
python
import requests
proxies = {'http':'user123:psw123@43.xxx.xxx.113:10801','https':'user123:psw123@43.xxx.xxx.113:10801'}
ip = requests.get('http://httpbin.org/ip',proxies=proxies)
print(ip.text)