import json
import requests
url = 'https://www.baidu.com'

with open('proxiex.txt', 'r', encoding='utf-8') as f:
    data = json.loads(f.read())
proxy = {
    'https': data['https']
}

resp = requests.get(url, stream=True, proxies=proxy)
ip_and_port = resp.raw._connection.sock.getpeername()
print(resp.text)
print(ip_and_port)


 posted on 2020-11-11 15:59  Rannie`  阅读(2295)  评论(0编辑  收藏  举报
去除动画
找回动画