import requests

 proxies={
'http':'http://192.168.1.1:88'
'https':'https://192.168.1.1:88'
#如果代理ip需要用户名和密码的话 'http':'user:password@192.168.1.1:88'
}
response = requests.get(url,proxies=proxies)
print(response.status_code) #如果代理类型不是http或者https,而是socks代理
#需要先 pip3 install 'requests[socks]
proxies={
'http':'socks5://192.168.1.1:88'
'https':'socks5://192.168.1.1:88'
#如果代理ip需要用户名和密码的话 'http':'user:password@192.168.1.1:88'
}
04-24 22:30
查看更多