python3批量查询域名是否注册
来源:互联网 发布:百度人工智能研究院 编辑:程序博客网 时间:2024/04/29 09:28
#!/usr/local/bin/python3#coding=utf-8import re,sys,os,random,time, base64import urllib.parse, urllib.requestimport sockettimeout = 10socket.setdefaulttimeout(timeout)proxy_list = [{'ip':"222.217.99.129", 'port':"9000", 'type':"http"},{'ip':"59.53.92.7", 'port':"8090", 'type':"http"},{'ip':"58.83.224.217", 'port':"8080", 'type':"http"},{'ip':"218.247.244.155", 'port':"8080", 'type':"http"},{'ip':"59.173.247.162", 'port':"8888", 'type':"http"},{'ip':"125.39.93.68", 'port':"8888", 'type':"http"},{'ip':"221.2.80.126", 'port':"8888", 'type':"http"},{'ip':"221.235.205.66", 'port':"8090", 'type':"http"},{'ip':"220.181.159.60", 'port':"8080", 'type':"http"},{'ip':"218.247.244.23", 'port':"8888", 'type':"http"},{'ip':"218.241.153.43", 'port':"8080", 'type':"http"},{'ip':"125.39.93.69", 'port':"8888", 'type':"http"},{'ip':"211.144.76.7", 'port':"8181", 'type':"http"},{'ip':"58.53.192.218", 'port':"8123", 'type':"http"},{'ip':"222.92.141.155", 'port':"8090", 'type':"http"},{'ip':"59.108.53.1", 'port':"8080", 'type':"http"},{'ip':"203.93.28.166", 'port':"8080", 'type':"http"},{'ip':"60.190.189.214", 'port':"8123", 'type':"http"},{'ip':"59.36.183.178", 'port':"8081", 'type':"http"},{'ip':"121.11.149.250", 'port':"8081", 'type':"http"},{'ip':"212.50.244.8", 'port':"8081", 'type':"http"},{'ip':"216.113.208.185", 'port':"8081", 'type':"http"},{'ip':"220.181.159.23", 'port':"8080", 'type':"http"},{'ip':"59.44.204.198", 'port':"8088", 'type':"http"},{'ip':"221.2.174.164", 'port':"8082", 'type':"http"},{'ip':"178.135.59.142", 'port':"8090", 'type':"http"},{'ip':"202.57.4.124", 'port':"8089", 'type':"http"},{'ip':"211.100.52.196", 'port':"8090", 'type':"http"},{'ip':"211.144.76.58", 'port':"9000", '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_pagedef 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 domainListdef 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批量查询域名是否注册
- python3批量查询域名是否注册
- 域名查询是否注册
- 查询域名是否注册代码
- 查询域名是否注册的类
- 查询域名是否注册(WHOIS)
- 万网域名查询是否注册接口
- asp.net 域名注册查询接口 支持批量后缀查询
- 域名批量查询软件
- 域名注册查询(php)
- asp.net 域名注册查询功能支持批量后缀查询模块
- 域名批量查询工具实测
- 批量域名查询 很惊艳
- 在线域名批量查询工具
- 多线程批量域名信息查询
- python3实现域名查询和whois查询
- python3实现域名查询和whois查询
- python3实现域名查询和whois查询
- Scrapy入门教程
- XPath教程
- ERROR [org.hibernate.property.BasicPropertyAccessor] IllegalArgumentException
- 深入python3 (Dive Into Python 3) 在线阅读与下载
- A Byte of Python (for Python 3.0) 下载
- python3批量查询域名是否注册
- 使用python3的base64编解码实现字符串的简易加密解密
- Python3的bytes/str之别
- python3获取天气预报
- python3给图片添加水印
- 新浪微博API OAuth1 Python3客户端
- python3和python2的区别
- poj 3180 The Cow Prom(强连通分量 Tarjan)
- 使用python移动飞信模块发送短信