python3批量查询域名是否注册
#!/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批量查询域名是否注册的更多相关文章
- 未注册wang域名批量查询工具
一.支持规则查询 可自定义生成域名进行查询,可生成任意位数的字母数字域名,根据[声母].[韵母]生成单拼,双拼,三拼等域名,还可根据字典生成,支持全拼.首拼识别,全国城市区号.城市全拼.城市首拼.热门 ...
- linux下查询域名或IP注册信息的操作记录(whois)
在运维工作中,有时需要查询某些域名的注册信息(域名的NS,注册用户,注册邮箱等),可以使用whois这个命令.whois命令令用来查找并显示指定帐号(或域名)的用户相关信息,因为它是到Network ...
- 根据域名查注册人信息,查询邮箱下注册过哪些IP,社工渗透,获取个人信息
根据域名查询注册人信息 举个例子.随便找一个网站 iappp.cn 通过whois查询,得到以下信息 我们可以得知这个域名的注册商(腾讯云),以及注册人真实姓名(也有可能是假的),还有注册人邮箱等等一 ...
- 【Python】批量查询-提取站长之家IP批量查询的结果加强版本v3.0
1.工具说明 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 某 ...
- Shell 命令行,实现对若干网站状态批量查询是否正常的脚本
Shell 命令行,实现对若干网站状态批量查询是否正常的脚本 如果你有比较多的网站,这些网站的运行状态是否正常则是一件需要关心的事情.但是逐一打开检查那简直是一件太糟心的事情了.所以,我想写一个 sh ...
- 《Advanced Bash-scripting Guide》学习(十):利用whois查询域名信息
本文所选的例子来自于<Advanced Bash-scripting Gudie>一书,译者 杨春敏 黄毅 Example 4-6. wh,whois域名查询 #!/bin/bash #做 ...
- 个人永久性免费-Excel催化剂功能第99波-手机号码归属地批量查询
高潮过往趋于平静,送上简单的手机号码归属地查询,因接口有数量限制,仅能满足少量数据需求,如有大规模数据却又想免费获得,这就成为无解了,数据有价,且用且珍惜. 业务使用场景 除了日常自带的手机各种管家为 ...
- 提取站长之家IP批量查询
1.工具说明 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 使 ...
- Python + MySQL 批量查询百度收录
做SEO的同学,经常会遇到几百或几千个站点,然后对于收录情况去做分析的情况 那么多余常用的一些工具在面对几千个站点需要去做收录分析的时候,那么就显得不是很合适. 在此特意分享给大家一个批量查询百度收录 ...
随机推荐
- vue学习笔记三:常见的表单绑定
<template> <div id="app"> <input type="checkbox" id="checked ...
- c#编程:给定一个正整数求出是几位数并逆序输出
<span style="color:#FF0000;">第一步:把输入的数字转为字符串n.ToString() 第二步:求出字符串的长度即为正整数的位数 第三步:从后 ...
- POJ 3627 Bookshelf 贪心 水~
最近学业上堕落成渣了.得开始好好学习了. 还有呀,相家了,好久没回去啦~ 还有和那谁谁谁... 嗯,不能发表悲观言论.说好的. 如果这么点坎坷都过不去的话,那么这情感也太脆弱. ----------- ...
- 附加数据库 对于server XXX失败
近期在学习MVC+EF,看着视频做小demo.EF这一块须要涉及到数据库的连接,视频中所讲的样例与先前牛腩新闻系统数据库挺类似的. 所以,就偷个懒,利用这个数据库,可是在附加的时候出错 ...
- 【solr专题之二】配置文件:solr.xml solrConfig.xml schema.xml 分类: H4_SOLR/LUCENCE 2014-07-23 21:30 1959人阅读 评论(0) 收藏
1.关于默认搜索域 If you are using the Lucene query parser, queries that don't specify a field name will use ...
- 试用 Tomcat7.x 与 Tomcat6.x 的明显不同 + Context 填写方法 + 默认应用配置方法 (zhuan)
http://blog.csdn.net/shanelooli/article/details/7408675
- Android自定义组件系列【3】——自定义ViewGroup实现侧滑
有关自定义ViewGroup的文章已经很多了,我为什么写这篇文章,对于初学者或者对自定义组件比较生疏的朋友虽然可以拿来主义的用了,但是要一步一步的实现和了解其中的过程和原理才能真真脱离别人的代码,举一 ...
- Android中动态设置GridView的列数、列宽和行高
在使用GridView时我们知道,列数是可以通过设计时的属性来设置的,列的宽度则是根据列数和GridView的宽度计算出来的.但是有些时候我们想实现列数是动态改变的效果,即列的宽度保持某个值,列的数量 ...
- Go语言版黑白棋
1.游戏说明 2.无边框窗口实现 3.背景图.最小化.关闭窗口 4.界面其它设计 5.黑白子提示闪烁效果 6.落子 7.初始化棋子.改变角色 8.倒计时 9.吃子 10.棋子个数统计.胜负判断 11. ...
- 数据局部性(data locality)
信息处理的典型模式是,将所有数据项视为一个集合,并将其组织为适宜的数据结构(或者说使用适宜的数据结构对之进行存储以及组织),进而借助操作接口高效访问. 为了考查和评价各操作接口的效率,除了从最坏情况的 ...