import requests
# 设置代理地址和端口
proxy_ip = '代理IP地址'
proxy_port = '代理端口号'
proxies = {
'http': 'http://{}:{}'.format(proxy_ip, proxy_port),
'https': 'https://{}:{}'.format(proxy_ip, proxy_port)
}
# 使用代理访问网页
response = requests.get('目标网页地址', proxies=proxies)
# 输出响应内容
print(response.text) |