python根据域名获得ip地址
def getIp(domain): import socket myaddr = socket.getaddrinfo(domain,'http')[0][4][0] print(myaddr)
其中domain为域名,如 www.sharejs.com,不能带http和url地址
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/8312.html
python根据域名获得ip地址
def getIp(domain): import socket myaddr = socket.getaddrinfo(domain,'http')[0][4][0] print(myaddr)
其中domain为域名,如 www.sharejs.com,不能带http和url地址
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/8312.html