域名查询是否注册的demo
import json
import multiprocessing
import threading
import requests
import xmltodict # 万网查询
def check_domin_www(file_path):
for line in open(file_path):
line = line.strip()
try:
url = f'''http://panda.www.net.cn/cgi-bin/check.cgi?area_domain={ line }.com'''
r = requests.get(url)
res_dict = xmltodict.parse(r.content.decode())
domin = res_dict['property']['key']
res = res_dict['property']['original'][:3]
print(res_dict)
if res == 210:
with open('domin_res.txt', 'a') as f:
f.write(domin)
f.write('\n')
except Exception as e:
print('出错了')
pass # 阿里云查询
def check_domin_aliyun(file_path):
for line in open(file_path):
line = line.strip()
try:
url = f'''https://checkapi.aliyun.com/check/checkdomain?domain={ line }.com&token=Yc0dc45c0cbd5d71276b9baf6d419c32f'''
r = requests.get(url)
res_dict = json.loads(r.content.decode())
if res_dict['success'] == 'true':
if res_dict['module'][0]['avail'] == 1:
with open('domin_res.txt', 'a') as f:
f.write(res_dict['module'][0]['name'])
f.write('\n')
else:
print(res_dict)
except Exception as e:
print('出错了')
pass # now查询
def check_domin_now(file_path):
for line in open(file_path):
line = line.strip()
try:
url = f'''https://checkapi.now.cn:8080/?domains={ line }.com'''
r = requests.get(url)
res_dict = json.loads(r.content.decode())
if res_dict['code'] == 100:
if res_dict['results'][0]['status'] == 1:
with open('domin_res.txt', 'a') as f:
f.write(res_dict['results'][0]['domain'])
f.write('\n')
else:
print(res_dict)
except Exception as e:
print(e)
pass # 中企动力查询
def check_domin_300(file_path):
for line in open(file_path):
line = line.strip()
try:
url = f'''https://api-shop.300.cn/domain/findDomainStatus?domainName={ line }&domainSuffix=.com'''
r = requests.get(url)
res_dict = json.loads(r.content.decode())
if res_dict['status'] == 101:
if res_dict['data']['domainStatus'] == 2:
with open('domin_res_300.txt', 'a') as f:
f.write(f'{ line }.com')
f.write('\n')
else:
print(res_dict)
except Exception as e:
import traceback
print(traceback.print_exc()) def run(file_path):
t = threading.Thread(target=check_domin_300, args=(file_path,))
t.start() if __name__ == '__main__': i = 23
while i < 27:
p = multiprocessing.Process(target=run, args=('E:/code/Modbus_RTU/passs/pass_{}.txt'.format(i),))
p.start() i += 1
域名查询是否注册的demo的更多相关文章
- linux下查询域名或IP注册信息的操作记录(whois)
在运维工作中,有时需要查询某些域名的注册信息(域名的NS,注册用户,注册邮箱等),可以使用whois这个命令.whois命令令用来查找并显示指定帐号(或域名)的用户相关信息,因为它是到Network ...
- 【转】万网域名查询接口(API)的说明
1.域名查询接口采用HTTP,POST,GET协议:调用URL:http://panda.www.net.cn/cgi-bin/check.cgi参数名称:area_domain 值为标准域名,例:h ...
- php调用whois接口域名查询
由两部分组成,一个index.php文件,一个whois的接口文件: <html> <head> <title>域名到期查询</title> <s ...
- 万网域名查询API接口
域名查询 接口地址:http://panda.www.net.cn/cgi-bin/check.cgi 接口采用HTTP,POST,GET协议 参数名称:area_domain 值为标准域名,例:nm ...
- python3实现域名查询和whois查询
关键字:python3 域名查询 域名查询接口 whois查询原文:http://www.cnblogs.com/txw1958/archive/2012/08/31/python3-domain-w ...
- dig 常用的域名查询工具
dig 命令是常用的域名查询工具,可以用来测试域名系统工作是否正常. 语法: dig (选项) (参数) 选项: @<服务器地址>: 指定进行域名解析的域名服务器: -b: 当主机具有多个 ...
- C#根据域名查询IP(CMD命令参数输入或者启动程序后再输入查询)
有时因为需要,希望知道域名的IP,那用C#怎么实现呢?以下是实现代码 using System; using System.Collections.Generic; using System.Linq ...
- 10.18 nslookup:域名查询工具
功能说明 nslookup命令是常用的域名解析查询工具. 如果系统没有nslookup命令,则需要安装下面的软件包: yum-y inatall bind-otil9 语法格式 nslookup ...
- nslookup域名查询命令查询ip
一.nslookup(name server lookup ) nslookup可以指定查询的类型,可以查到DNS记录的生存时间还可以指定使用哪个DNS服务器进行解释.在已安装TCP/IP协议的电脑上 ...
随机推荐
- 常用数据存储格式之json
常用数据存储格式介绍 JSON: JavaScript Object Notation(JavaScript 对象表示法) JSON 是存储和交换文本信息的语法.类似 XML. JSON 比 XML ...
- Windows 聚焦的锁屏壁纸设置为桌面壁纸
需求: Windows的锁屏壁纸偶尔遇到非常喜欢的壁纸,想设置为桌面壁纸. 步骤如下: 1. “Windows 聚焦”的锁屏壁纸都保存在隐藏文件夹 --- Assets里. a. 打开“资源管理器 b ...
- 面试复习题(一)Java系列
(根据自己的理解和根据黑马资料总结—意见不统一我会写上自己的理解) 一.Java面向对象 1.面向对象都有哪些特性以及你对这些特性的理解 继承.封装.多态.(抽象) 2.public,private, ...
- MyEclipse开发秘籍——使用DevStyle Icon Designer(一)
[MyEclipse CI 2019.4.0安装包下载] DevStyle主题包括一个Icon Designer,允许您自定义图标.Icon Designer包含在DevStyle主题中,可作为Ecl ...
- k8sDaemonSet控制器
DaemonSet用于再集群中的全部节点上同时运行一份指定的pod资源副本,后续新加入的工作节点也会自动创建一个相关的pod对象,当从集群中移除节点时,此类pod对象也将被自动回收而无须重建.也可以使 ...
- 【C#-算法】根据生日自动计算年龄_DataTime 的 DateDiff 方法
dateTimePicker1.Value出生日期控件的值 long BirthDay = DateAndTime.DateDiff(DateInterval.Year, dateTimePicker ...
- oracle 循环的一种写法
for v_n in( select bb.temNum, bb.LOANTYPE from (select decode(bns.assignstate, '{016D68F9-719B-4EFC- ...
- laravel短信验证
短信验证按钮倒计时功能: $('.btn').click(function(){ var time = 59; // $('.btn').css('background-color','#ccc'); ...
- IE大文件断点续传
IE的自带下载功能中没有断点续传功能,要实现断点续传功能,需要用到HTTP协议中鲜为人知的几个响应头和请求头. 一. 两个必要响应头Accept-Ranges.ETag 客户端每次提交下载请求时,服务 ...
- UOJ #460. 新年的拯救计划 神仙题+构造
对于这个神仙题,我还能说什么~ 第一个答案=$n/2$ 还是比较好猜的. 对于构造这个树,大概就是先从 $1$ 号节点向 $n/2$ 距离以内都连一条边,再在第 $n/2$ 个节点进行这个操作,然后从 ...