下边内容段是关于python根据域名获得ip地址的内容,应该能对各朋友有一些用处。
def getIp(domain):
import socket
myaddr = socket.getaddrinfo(domain,'http')[0][4][0]
print(myaddr)