<?xml version="1.0" encoding="gb2312"?>
<property>
<returncode>200</returncode>
<key>google.com</key>
<original>211 : Domain name is not available</original>
</property>
上面的是域名已经被注册的返回页面,下面的是域名未被注册的页面,代码分别是211,210
<?xml version="1.0" encoding="gb2312"?>
<property>
<returncode>200</returncode>
<key>googleloveyou.com</key>
<original>210 : Domain name is available</original>
</property>
def domain_name(num):
"""域名组合生成器"""
name = min(num)
last = max(num, string_len-1)
while True:
yield num_2_string(name, string)
if name == last:
break
name[num-1] += 1
while string_len in name:
index = name.index(string_len)
name[index] = 0
name[index-1] += 1
def run(domain_lenth):
"""执行,如果每被注册就写到文件中"""
f = open(fname, 'a')
for domain in domain_name(domain_lenth):
domain += suffix
if is_ava(domain):
f.write('%s\n' % domain)
f.flush()
time.sleep(0.5)
if __name__ == '__main__':
"""最终执行, 循环执行每种长度组合"""
for i in domain_lenth_range:
run(i)