#!/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. DMA 如何查看它有没有传输完成 传输完成再开启

    摘自:https://blog.csdn.net/zzwdkxx/article/details/9026173 /////////////////////////////////////////// ...

  2. 机器学习算法笔记1_2:分类和逻辑回归(Classification and Logistic regression)

    形式: 採用sigmoid函数: g(z)=11+e−z 其导数为g′(z)=(1−g(z))g(z) 如果: 即: 若有m个样本,则似然函数形式是: 对数形式: 採用梯度上升法求其最大值 求导: 更 ...

  3. HBase -ROOT-和.META.表结构(region定位原理) 分类: B7_HBASE 2015-03-13 20:52 90人阅读 评论(0) 收藏

    在HBase中,大部分的操作都是在RegionServer完成的,Client端想要插入,删除,查询数据都需要先找到相应的RegionServer.什么叫相应的RegionServer?就是管理你要操 ...

  4. Size Balanced Tree(SBT树)整理

    不想用treap和Splay,那就用SB树把,哈哈,其实它一点也SB,厉害着呢. 先膜拜一下作者陈启峰.Orz 以下内容由我搜集整理得来. 一.BST及其局限性 二叉查找树(Binary Search ...

  5. 调用另一个Activity 分类: H1_ANDROID 2013-09-22 14:11 2217人阅读 评论(0) 收藏

    参考自Google官方文档Traning/Getting Started/Building a simple user interface, Startinganother activity,http ...

  6. SRA解密报错:Data must start with zero

    项目背景:要对打印地址进行加密,用公钥加密后会乱码需要base64 decode一下,但是在解密时报错:javax.crypto.BadPaddingException: Data must star ...

  7. [Ramda] Create a Query String from an Object using Ramda's toPairs function

    In this lesson, we'll use Ramda's toPairs function, along with map, join, concatand compose to creat ...

  8. js的dom对象(带实例超详细全解)

    js的dom对象(带实例超详细全解) 一.总结 一句话总结: 1.DOM中的方法区分大小写么? 解答:区分 2.DOM中元素和节点的关系式什么? 解答:元素就是标签,节点中有元素节点,也是标签,节点中 ...

  9. idea中建立一个OSGI项目

    参考网址:http://chenjingbo.iteye.com/blog/1893597 首先我使用的是equinox作为我的osgi framework 直接在官网上解压下载即可,第一步creta ...

  10. [React] displayName for stateless component

    We can use 'displayName' on component to change its component tag in dev tool: import React from 're ...