Skip to content

Commit

Permalink
changed
Browse files Browse the repository at this point in the history
  • Loading branch information
xiao committed Jul 1, 2015
1 parent a4f38b9 commit cc20539
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def querySubdomain(domain):
for node in nodes:
print node, getTitle(node)

def queryRDNS(domain):
def queryRDNS_old(domain):
hostInfos = socket.gethostbyname_ex(domain) #r = (hostname, aliaslist, ipaddrlist)
for ipaddr in hostInfos[2]:
maxpage = 1
Expand All @@ -84,6 +84,20 @@ def queryRDNS(domain):
print e
#pass

def queryRDNS(domain):
hostInfos = socket.gethostbyname_ex(domain) #r = (hostname, aliaslist, ipaddrlist)
for ipaddr in hostInfos[2]:
try:
response = urllib2.urlopen('http://dns.aizhan.com/%s/' % (ipaddr))
text = response.read()
tree = etree.HTML(text)
nodes = tree.xpath(r"//td[@class='dns-links']/a/@href")
for node in nodes:
print node
except Exception, e:
print e


def toStr(l):
#print type(l)
if type(l) != types.ListType:
Expand Down

0 comments on commit cc20539

Please sign in to comment.