时间:2021-07-01 10:21:17 帮助过:536人阅读
#-*- coding:gbk -*- import urllib2 import re try: while True: ipaddr = raw_input("Enter IP Or Domain Name:") if ipaddr == "" or ipaddr == 'exit': break else: url = "http://www.ip138.com/ips138.asp?ip=%s&action=2" % ipaddr u = urllib2.urlopen(url) s = u.read() #Get IP Address ip = re.findall(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}',s) print "\n****** Below Result From IP138 Database *****" print "IP Address:",ip[0] #Get IP Address Location result = re.findall(r'(
以上所述就是本文的全部内容了希望大家能够喜欢。