python根据域名获得ip地址
def getIp(domain): import socket myaddr = socket.getaddrinfo(domain,'http')[0][4][0] print(myaddr)
其中domain为域名,如 www.75271.com,不能带http和url地址
python根据域名获得ip地址
def getIp(domain): import socket myaddr = socket.getaddrinfo(domain,'http')[0][4][0] print(myaddr)
其中domain为域名,如 www.75271.com,不能带http和url地址