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. LeetCode_Bit Manipulation

    231. Power of Two Given an integer, write a function to determine if it is a power of two. class Sol ...

  2. Codeforces 1000 组合数可行线段倒dp 边双联通缩点求树直径

    A /*Huyyt*/ #include<bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) using namespace std ...

  3. 原型模式故事链(5)--JS变量作用域、作用域链、闭包

    上一章 JS执行上下文.变量提升.函数声明 传送门:https://segmentfault.com/a/11... 本次我们主要讲讲变量作用域和闭包变量作用域:顾名思义:变量起作用的范围.变量分为全 ...

  4. sudo 不用输入密码

    3. 设置当前登陆用户免密 使用visudo打开sudoers并编辑 sudo visudo 在刚才编辑的内容中加上NOPASSWD: linuxidc ALL=(ALL:ALL) NOPASSWD: ...

  5. 更新protobuf

    sudo pip install --upgrade protobuf sudo apt-get install libprotobuf-dev protobuf-compiler这个不知道是什么问题 ...

  6. chomd添加权限

    chmod 777 -R * 的意思是把当前目录所有文件(递归的)的属性全部为7

  7. 【Layui】当Layui数据表格和Layui下拉框组合时发生的问题

    关于Layui数据表格用下拉框显示问题 如图所示 可以看见当点击下拉框时下拉选项被下拉框覆盖 此时你需要在数据表格渲染完成时的回调内添加如下代码即可 $(".sel_scrq"). ...

  8. Java多线程和并发(十一),CAS(Compare and Swap)

    目录 1.CAS简介 2.CAS多数情况下对开发者来说是透明的 3.CAS缺点 十一.CAS(Compare and Swap) Synchronized直观意义上是一种悲观锁 cas则是乐观锁的一种 ...

  9. BZOJ 1231: [Usaco2008 Nov]mixup2 混乱的奶牛 状态压缩dp

    开始读错题了,然后发现一眼切~ Code: #include <cstdio> #include <algorithm> #define ll long long #defin ...

  10. Linux—查看路由

    下面那些命令可以用来查看Linux主机的默认路由() A.route B.ifconfig C.ping D.netstat 分析: A.route命令用来显示目前本机路由表的内容,并且还可以针对路由 ...