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的更多相关文章

  1. linux下查询域名或IP注册信息的操作记录(whois)

    在运维工作中,有时需要查询某些域名的注册信息(域名的NS,注册用户,注册邮箱等),可以使用whois这个命令.whois命令令用来查找并显示指定帐号(或域名)的用户相关信息,因为它是到Network ...

  2. 【转】万网域名查询接口(API)的说明

    1.域名查询接口采用HTTP,POST,GET协议:调用URL:http://panda.www.net.cn/cgi-bin/check.cgi参数名称:area_domain 值为标准域名,例:h ...

  3. php调用whois接口域名查询

    由两部分组成,一个index.php文件,一个whois的接口文件: <html> <head> <title>域名到期查询</title> <s ...

  4. 万网域名查询API接口

    域名查询 接口地址:http://panda.www.net.cn/cgi-bin/check.cgi 接口采用HTTP,POST,GET协议 参数名称:area_domain 值为标准域名,例:nm ...

  5. python3实现域名查询和whois查询

    关键字:python3 域名查询 域名查询接口 whois查询原文:http://www.cnblogs.com/txw1958/archive/2012/08/31/python3-domain-w ...

  6. dig 常用的域名查询工具

    dig 命令是常用的域名查询工具,可以用来测试域名系统工作是否正常. 语法: dig (选项) (参数) 选项: @<服务器地址>: 指定进行域名解析的域名服务器: -b: 当主机具有多个 ...

  7. C#根据域名查询IP(CMD命令参数输入或者启动程序后再输入查询)

    有时因为需要,希望知道域名的IP,那用C#怎么实现呢?以下是实现代码 using System; using System.Collections.Generic; using System.Linq ...

  8. 10.18 nslookup:域名查询工具

    功能说明 nslookup命令是常用的域名解析查询工具. 如果系统没有nslookup命令,则需要安装下面的软件包: yum-y inatall bind-otil9   语法格式 nslookup ...

  9. nslookup域名查询命令查询ip

    一.nslookup(name server lookup ) nslookup可以指定查询的类型,可以查到DNS记录的生存时间还可以指定使用哪个DNS服务器进行解释.在已安装TCP/IP协议的电脑上 ...

随机推荐

  1. 双向链表/list

    双向链表结构如下 双向链表结构中元素在内存中不是紧邻空间,而是每个元素中存放上一个元素和后一个元素的地址 第一个元素称为头(head)元素,前连接(前置指针域)为nil 最后一个元素称为尾(foot) ...

  2. MHA介绍和基础、原理、架构、工具介绍

    一.MHA简介 软件简介 MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于Facebo ...

  3. BZOJ1079 [SCOI2008]着色方案[组合计数DP]

    $有a_{1}个1,a_{2}个2,...,a_{n}个n(n<=15,a_{n}<=5),求排成一列相邻位不相同的方案数.$ 关于这题的教训记录: 学会对于复杂的影响分开计,善于发现整体 ...

  4. Kendo UI for jQuery使用教程——创建自定义捆绑包

    [Kendo UI for jQuery最新试用版下载] Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support ...

  5. nginx第一天

    nginx 介绍 常见的webserver(排行https://news.netcraft.com/archives/2018/) 老牌:httpd(早期叫Apache),开源,市场份额最高 微软:i ...

  6. vue前端与django后端数据交互

    //把数据传到路径为/airCdt/的django后端函数进行数据处理 onSubmit(){ const dict={ 'floor': this.formLabelAlign.floor, 'ro ...

  7. JVM性能调优监控工具jps、jstack、jmap、jhat、jstat、jinfo、jconsole使用详解

    JDK本身提供了很多方便的JVM性能调优监控工具,除了集成式的VisualVM和jConsole外,还有jps.jstack.jmap.jhat.jstat等小巧的工具,本博客希望能起抛砖引玉之用,让 ...

  8. 【Winform-右下角弹窗】实现右下角弹窗,提示信息

    网页是否经常在电脑右下角弹窗显示消息?其实Winform也是可以实现的.下面介绍两种方法. 第一步:设计窗体 第二步:实现代码 第一种方法 引用user32 声明常量 窗体Load事件 窗体FormC ...

  9. 我在做评论功能时学到的js一些思路

    在提交评论的时候,如何判断是一级评论还是二级评论(因为都是通过一个文本域提交评论),思路:声明一个全局变量,如果是回复(二级评论)那么会触发点击回复事件,在这个事件的回调函数里给全局变量设置为true ...

  10. cordova打包项目下载gradle失败

    在使用cordova打包项目的时候有时会因为网络环境原因导致下载gradle失败的情况,个人找到两种解决方案. 方案一: 根据报错的提示选择要下载的gradle去浏览器中下载,然后将gradle压缩包 ...