コード例 #1
0
ファイル: alexa.py プロジェクト: salvachz/iptodns
 def parse_pages(self, response):
     ipToDns = IpToDns()
     for url in response.css('#alx-content > div > section.content-fixed.page-product-content > span > span > section > div.listings > ul > li > div.desc-container > p > a::text').extract():
         domain = url.lower()
         dns_id = ipToDns.add_DNS(domain)
         ips = ipToDns.get_IPs(domain)
         for ip in ips:
             ipToDns.add_IP_to_DNS(ip, dns_id)
         yield {'domain': domain, 'IPs':ips}
コード例 #2
0
 def parse_pages(self, response):
     ipToDns = IpToDns()
     for url in response.css(
             '#alx-content > div > section.content-fixed.page-product-content > span > span > section > div.listings > ul > li > div.desc-container > p > a::text'
     ).extract():
         domain = url.lower()
         dns_id = ipToDns.add_DNS(domain)
         ips = ipToDns.get_IPs(domain)
         for ip in ips:
             ipToDns.add_IP_to_DNS(ip, dns_id)
         yield {'domain': domain, 'IPs': ips}
コード例 #3
0
#!/usr/local/bin/python2.7

from iptodns import IpToDns
import sys

if len(sys.argv) == 2:

    domain = sys.argv[1]
    ipToDns = IpToDns()
    dns_id = ipToDns.add_DNS(domain)
    ips = ipToDns.get_IPs(domain)
    for ip in ips:
        ipToDns.add_IP_to_DNS(ip, dns_id)
    print "OK! Add with success!"
else:
    print "Error"