import requests
url = "http://www.ip181.com/"
proxies = {"https":"175.8.27.130:808",
"https":"175.8.27.130:999"}
response = requests.get(url,proxies = proxies)
print response.text上述中,proxies中的参数必须都是"https"开头才能正常访问网站proxies = {"http":"175.8.27.130:808", "https":"175.8.27.130:999"} 会报错而在访问百度页面时(以下代码部分),proxies中的参数必须都是"http"开头才能正常访问网站import requests
proxies= {
"http":"http://175.8.27.130:808",
"http":"http://175.8.27.130:999"
}
response = requests.get("https://www.baidu.com",proxies=proxies)
print response.textproxies = {"http":"175.8.27.130:808", "https":"175.8.27.130:999"} 会报错而将访问百度的代码改成proxies= {"http":"http://175.8.27.130:808"} 单独一条也能正常访问上述报错内容如下图:1. proxies里的参数 什么时候该填写"http",什么时候该填写"https" ?2. 为什么 proxies = {"http":"175.8.27.130:808", "https":"175.8.27.130:999"} 一个"http",一个"https"会报错? (我看到网上很多教程都是 一个"http",一个"https")
添加回答
举报
0/150
提交
取消