import requests
url = "http://pv.sohu.com/cityjson?ie=utf-8"
print("原有IP: " + requests.get(url).text)
ip = "183.143.56.94"
port = "22045"
new_data = {"http" : ip + ":" + port }
print(new_data)
# proxies=IP requests模块构建请求
print("代理后的IP: " + requests.get(url, proxies=new_data).text)
# 切换回自己的IP是 当前代理IP失效后向代理IP提供商获取新IP的时候需要使用自己的ip
print("切换回自己的IP: " + requests.get(url, proxies={"http": ""}).text)
https://www.bilibili.com/video/BV1MW411t7Ex?from=search&seid=3922119669773508568&spm_id_from=333.337.0.0
https://blog.csdn.net/weixin_34360651/article/details/86024928
网友评论