ip代理

import requests
#根据协议类型选择不同的代理
# proxies = {
# "http":"182.202.222.155:61234",
# "https":"50.233.137.36:80"
# }
# response = requests.request("get","https://www.baidu.com/",proxies=proxies)
# print(response.text)


#私密代理验证
# 格式:用户名:密码@主机IP:端口
value = "mr_mao_hacker:sffqry9r@61.158.163.130:16816"
proxy = {"http":value}
response = requests.get("http://www.baidu.com",proxies=proxy)
print(response.text)
#火车站、公交车、咖啡店、麦当劳
#web客户端验证,需要添加auth=(账号,密码)
auth = {"test":"123456"}
response = requests.get("http://192.168.190.107",auth = auth)
print(response.text)
posted @ 2018-04-18 19:07  崔恒跃  阅读(217)  评论(0编辑  收藏  举报