#!/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. anaconda中实现双spyder版本

    1)先在conda中创建一个名为python2的环境,并下载对应版本python2.7 conda create --name python27 python=2.7 2)激活python2环境 ac ...

  2. ZOJ 3171 The Hidden 7's DP

    传送门:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3203 题目大意给定一串字符串,需要计算出seven的个数. #incl ...

  3. chain rule 到 Markov chain

    1. 联合概率(joint distribution)的链式法则 基于链式法则的 explicit formula: p(x1:n)===p(x)p(x1)∏i=2np(xi|x1,-,xi−1)∏i ...

  4. Chinese remainder theorem

    https://en.wikipedia.org/wiki/Chinese_remainder_theorem http://planetmath.org/ChineseRemainderTheore ...

  5. js进阶 11-17 juqery如何查找一个元素的同级元素

    js进阶 11-17 juqery如何查找一个元素的同级元素 一.总结 一句话总结:三个方法,向前(prev()),向后(next())和兄弟(siblings()),而前面两个每个都对应三个,pre ...

  6. 搭建基于java环境

    .net项目架构改造之搭建基于java环境配置一览[上]   最近公司做了一个项目,需要嵌套在千牛的客户端上,项目代码必须上阿里的聚石塔,全程采用基于docker的自动化部署,我们的项目是基于.net ...

  7. WP8.1开发:后台任务详解(求推荐)

    小梦今天给大家分享一下windows phone 8.1中的后台任务如何实现,许多应用都会用到后台任务,所以我们必须得掌握. 新建后台任务类: 首先我们先新建一个windows phone 8.1空白 ...

  8. 【33.20%】【LA 4320】【Ping pong】

    [Description] N (3 ≤ N ≤ 20000) ping pong players live along a west-east street(consider the street ...

  9. http各种状态码具体解释

    1XX (暂时响应)   100(继续) 请求者应当继续提出请求.   101(切换协议)请求者已要求server切换协议,server已确认并准备切换 2XX(成功)    ·200(成功) ser ...

  10. js进阶正则表达式15验证身份证号(|符号的使用:var reg=/^\d{17}[\d|X]$|^\d{15}$/)(str的方法substr)

    js进阶正则表达式15验证身份证号(|符号的使用:var reg=/^\d{17}[\d|X]$|^\d{15}$/)(str的方法substr) 一.总结 1.|符号的使用:var reg=/^\d ...