import requests
r = requests.get('https://www.baidu.com/', stream=True)
print(r.raw._connection.sock.getpeername()[0])
print(r.raw._connection.sock.getsockname()[0])
import requests
r = requests.get('https://www.baidu.com/', stream=True)
print(r.raw._connection.sock.getpeername()[0])
print(r.raw._connection.sock.getsockname()[0])
本文标题:python学习笔记9——requests 获取当前ip
本文链接:https://www.haomeiwen.com/subject/rmbibftx.html
网友评论