import requests
url = 'http://www.xicidaili.com'
# <!-- 添加proxy -->
proxy = {
'http':'http://root:Yao+ql2011@101.200.50.18:8118'
}
# <!-- 添加 headers -->
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
}
# <!-- 调用requests,得到response -->
response = requests.get(url,headers=headers,proxies=proxy)
print(response.text)
with open('xicidaili.html','wb') as f:
f.write(response.content)
requests_xcdl(requests_西刺代理)
最新推荐文章于 2019-05-10 21:35:55 发布
