#!/usr/local/bin/python3
#coding=utf-8 import re,sys,os,random,time, base64
import urllib.parse, urllib.request
import socket timeout = 10
socket.setdefaulttimeout(timeout) proxy_list = [
{'ip':"222.217.99.129", 'port':"", 'type':"http"},
{'ip':"59.53.92.7", 'port':"", 'type':"http"},
{'ip':"58.83.224.217", 'port':"", 'type':"http"},
{'ip':"218.247.244.155", 'port':"", 'type':"http"},
{'ip':"59.173.247.162", 'port':"", 'type':"http"},
{'ip':"125.39.93.68", 'port':"", 'type':"http"},
{'ip':"221.2.80.126", 'port':"", 'type':"http"},
{'ip':"221.235.205.66", 'port':"", 'type':"http"},
{'ip':"220.181.159.60", 'port':"", 'type':"http"},
{'ip':"218.247.244.23", 'port':"", 'type':"http"},
{'ip':"218.241.153.43", 'port':"", 'type':"http"},
{'ip':"125.39.93.69", 'port':"", 'type':"http"},
{'ip':"211.144.76.7", 'port':"", 'type':"http"},
{'ip':"58.53.192.218", 'port':"", 'type':"http"},
{'ip':"222.92.141.155", 'port':"", 'type':"http"},
{'ip':"59.108.53.1", 'port':"", 'type':"http"},
{'ip':"203.93.28.166", 'port':"", 'type':"http"},
{'ip':"60.190.189.214", 'port':"", 'type':"http"},
{'ip':"59.36.183.178", 'port':"", 'type':"http"},
{'ip':"121.11.149.250", 'port':"", 'type':"http"},
{'ip':"212.50.244.8", 'port':"", 'type':"http"},
{'ip':"216.113.208.185", 'port':"", 'type':"http"},
{'ip':"220.181.159.23", 'port':"", 'type':"http"},
{'ip':"59.44.204.198", 'port':"", 'type':"http"},
{'ip':"221.2.174.164", 'port':"", 'type':"http"},
{'ip':"178.135.59.142", 'port':"", 'type':"http"},
{'ip':"202.57.4.124", 'port':"", 'type':"http"},
{'ip':"211.100.52.196", 'port':"", 'type':"http"},
{'ip':"211.144.76.58", 'port':"", 'type':"http"}
] def request_domain(domain):
have_error = True
while have_error:
try:
url = 'http://pandavip.www.net.cn/check/check_ac1.cgi'
user_agent = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)'
values = {'domain' : domain,}
headers = { 'User-Agent' : user_agent }
data = urllib.parse.urlencode(values).encode()
req = urllib.request.Request(url, data, headers) index = random.randint(0, len(proxy_list) - 1)
proxy = proxy_list[index] if True:
proxy_support = urllib.request.ProxyHandler({proxy['type']: proxy['ip'] +':' + proxy['port']})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener) response = urllib.request.urlopen(req)
the_page = response.read().decode("utf8") except Exception as e:
have_error = True
proxy_list.pop(index)
## print(">>>>>>>>>>> EXCEPTION: " + proxy['ip']+ " " + str(e))
else:
have_error = False
else:
return the_page def construct_domain():
domainList = []
domainList.append({'pre': "doucube", 'ext': "com"})
domainList.append({'pre': "doucube", 'ext': "net"})
domainList.append({'pre': "doucube", 'ext': "org"})
domainList.append({'pre': "doucube", 'ext': "cn"}) for i in range(97, 123):
domain_pre = chr(i)
domainList.append({'pre': domain_pre, 'ext': "cn"}) return domainList def main(): domains = construct_domain() for i in range(0, len(domains)):
domain_full = domains[i]['pre'] + "." + domains[i]['ext']
result = request_domain(domain_full)
cur_time = str(time.strftime("%H:%M:%S", time.localtime()))
if result.find("is not available") != -1:
print(cur_time + "\t" + domain_full + "\tOccupied!")
elif result.find("is available") != -1:
print(cur_time + "\t" + domain_full + "\tFREE! ------->$")
else:
print(cur_time + "\t" + domain_full + "\t" + result) if __name__ == '__main__':
main()
print(base64.b64decode(b'Q29weXJpZ2h0IChjKSAyMDEyIERvdWN1YmUgSW5jLiBBbGwgcmlnaHRzIHJlc2VydmVkLg==').decode())

运行结果:

*** Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32. ***
>>>
*** Remote Interpreter Reinitialized ***
>>>
12:21:12 doucube.com Occupied!
12:21:15 doucube.net FREE! ------->$
12:21:29 doucube.org FREE! ------->$
12:21:30 doucube.cn FREE! ------->$
12:21:30 a.cn Occupied!
12:21:33 b.cn Occupied!
12:21:35 c.cn Occupied!
12:21:35 d.cn Occupied!
12:21:37 e.cn Occupied!
12:21:38 f.cn Occupied!
12:21:38 g.cn Occupied!
12:21:42 h.cn Occupied!
12:21:42 i.cn Occupied!
12:21:43 j.cn Occupied!
12:21:45 k.cn Occupied!
12:21:49 l.cn Occupied!
12:21:50 m.cn Occupied!
12:21:50 n.cn Occupied!
12:21:50 o.cn Occupied!
12:21:53 p.cn Occupied!
12:21:53 q.cn Occupied!
12:21:56 r.cn Occupied!
12:21:56 s.cn Occupied!
12:22:06 t.cn Occupied!
12:22:07 u.cn Occupied!
12:22:08 v.cn Occupied!
12:22:08 w.cn Occupied!
12:22:08 x.cn Occupied!
12:22:10 y.cn Occupied!
12:22:11 z.cn Occupied! Copyright (c) 2012 Doucube Inc. All rights reserved. >>>

python3批量查询域名是否注册的更多相关文章

  1. 未注册wang域名批量查询工具

    一.支持规则查询 可自定义生成域名进行查询,可生成任意位数的字母数字域名,根据[声母].[韵母]生成单拼,双拼,三拼等域名,还可根据字典生成,支持全拼.首拼识别,全国城市区号.城市全拼.城市首拼.热门 ...

  2. linux下查询域名或IP注册信息的操作记录(whois)

    在运维工作中,有时需要查询某些域名的注册信息(域名的NS,注册用户,注册邮箱等),可以使用whois这个命令.whois命令令用来查找并显示指定帐号(或域名)的用户相关信息,因为它是到Network ...

  3. 根据域名查注册人信息,查询邮箱下注册过哪些IP,社工渗透,获取个人信息

    根据域名查询注册人信息 举个例子.随便找一个网站 iappp.cn 通过whois查询,得到以下信息 我们可以得知这个域名的注册商(腾讯云),以及注册人真实姓名(也有可能是假的),还有注册人邮箱等等一 ...

  4. 【Python】批量查询-提取站长之家IP批量查询的结果加强版本v3.0

    1.工具说明 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 某 ...

  5. Shell 命令行,实现对若干网站状态批量查询是否正常的脚本

    Shell 命令行,实现对若干网站状态批量查询是否正常的脚本 如果你有比较多的网站,这些网站的运行状态是否正常则是一件需要关心的事情.但是逐一打开检查那简直是一件太糟心的事情了.所以,我想写一个 sh ...

  6. 《Advanced Bash-scripting Guide》学习(十):利用whois查询域名信息

    本文所选的例子来自于<Advanced Bash-scripting Gudie>一书,译者 杨春敏 黄毅 Example 4-6. wh,whois域名查询 #!/bin/bash #做 ...

  7. 个人永久性免费-Excel催化剂功能第99波-手机号码归属地批量查询

    高潮过往趋于平静,送上简单的手机号码归属地查询,因接口有数量限制,仅能满足少量数据需求,如有大规模数据却又想免费获得,这就成为无解了,数据有价,且用且珍惜. 业务使用场景 除了日常自带的手机各种管家为 ...

  8. 提取站长之家IP批量查询

    1.工具说明 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 使 ...

  9. Python + MySQL 批量查询百度收录

    做SEO的同学,经常会遇到几百或几千个站点,然后对于收录情况去做分析的情况 那么多余常用的一些工具在面对几千个站点需要去做收录分析的时候,那么就显得不是很合适. 在此特意分享给大家一个批量查询百度收录 ...

随机推荐

  1. Eclipse下配置Ant脚本 自己主动打包带签名的Android apk

    尽管eclipse非常少用了,可是在古老的项目上还是会用到.一个麻烦事是打带签名包的时候.非常不方便.下边纪录下配置ant,自己主动打包带签名apk的过程,作为备忘.(PC环境为MAC) 1,第一步得 ...

  2. [Angular 2] Set Values on Generated Angular 2 Templates with Template Context

    Angular 2 templates have a special let syntax that allows you to define and pass a context when they ...

  3. 借助gdb实现pstack

    pstack.sh: #! /bin/sh if [ -z $1 ] then echo "gdb script for print stack" echo "usage ...

  4. js进阶正则表达式实现过滤字符串(RegExp对象操作正则表达式)(正则:regular)(表达式:expression)

    js进阶正则表达式实现过滤字符串(RegExp对象操作正则表达式)(正则:regular)(表达式:expression) 一.总结 1.str_replace:正则作用:高效快速匹配 2.break ...

  5. 【9207&&b701】统计数字(NOIP2007)

    问题描述 某次科研调查时得到了n个自然数,每个数均不超过1500000000 (1.5*109).已知不相同的数不超过10000个,现在需要统计这些自然数各自出现的次数,并按照自然数从小到大的顺序输出 ...

  6. C++中回调(CallBack)的使用方法(其实就是类方法指针,我觉得你的方法易用性不好,虽然原理正确)

    回调函数是一个很有用,也很重要的概念.当发生某种事件时,系统或其他函数将会自动调用你定义的一段函数.回调函数在windows编程使用的场合很多,比如Hook回调函数:MouseProc,GetMsgP ...

  7. Redis的增删改查命令总结与持久化方式

    原文:Redis的增删改查命令总结与持久化方式 Redis是用C语言实现的,一般来说C语言实现的程序"距离"操作系统更近,执行速度相对会更快. Redis使用了单线程架构,预防了多 ...

  8. java使用mongoDB和freemarker注意事项

    mongoDB和关系数据库的差异最大的优势就是表结构不正确,说:.弱事务.mongoDB以牺牲换来的交易进行更快的访问速度,有人说mongoDB对于内存太贪婪,事实上,它不会.随着windows版本, ...

  9. 学习OpenCV研究报告指出系列(二)源代码被编译并配有实例project

    下载并安装CMake3.0.1       要自己编译OpenCV2.4.9的源代码.首先.必须下载编译工具,使用的比較多的编译工具是CMake. 以下摘录一段关于CMake的介绍: CMake是一个 ...

  10. PHPDocumentor 整理目光规范

    你会写凝视么?从我写代码開始.这个问题就一直困扰着我.相信也相同困扰着其它同学.曾经的写凝视总是没有一套行之有效的标准,给维护和协同开发带了很多麻烦,直到近期读到了phpdocumentor的凝视标准 ...