域名查询是否注册的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协议的电脑上 ...
随机推荐
- 05-spring框架—— Spring 事务
5.1 Spring 的事务管理 事务原本是数据库中的概念,在 Dao 层.但一般情况下,需要将事务提升到业务层,即 Service 层.这样做是为了能够使用事务的特性来管理具体的业务. 在 Spri ...
- 加上这几个组件,flask摇身一变是django
写在前面 flask和django作为python中的两大开源框架,各分春秋,各有各自的优点,不能一概而论说哪个好哪个不好.flask框架小而精,适用于快速开发一些小的应用的项目.django大而全, ...
- ZOJ red black tree
#include <bits/stdc++.h> #define fi first #define se second #define lson l,m,rt<<1 #defi ...
- 欧拉函数 || Calculation 2 || HDU 3501
题面: 题解:欧拉函数的基础应用,再套个很 easy 的等差数列前 n 项和就成了. 啊,最近在补作业+准备月考+学数论,题就没怎么写,感觉菜得一匹>_< CSL加油加油~! 代码: #i ...
- GO (待更新)
日期20190531,GO AND TOOLS FOR HOME 0 环境搭建 https://golang.org/dl/ Install the Go tools If you are upgr ...
- k8sConfigMap资源
ConfigMap对象用于为容器中的应用提供配置数据以定制程序的行为,不过敏感的配置信息,例如密钥.证书等通常由Secret对象来进行配置.他们将相应的配置信息保存于对象中,而后在pod资源上以存储卷 ...
- 总结c语言
这个月的总结,我学到的知识虽然不是很多,学的很慢,也不懂什么意思,也没有多加去复习,也许这就是不去敲代码的代价,也只会简单的代码,学的时候真的是找不到思路,觉得这代码跟着老师讲课照着输入进去就可以了, ...
- jquery easyui 日历控件和文本框结合使用生成日期
html部分---等待接收所选日期的文本框 <td> <input name='input_date' required class='easyui-textbox' id='xiw ...
- php的异步非阻塞swoole模块使用(一)实现简易tcp服务器--服务端
绑定tcp服务器的地址 $swserver = new swoole_server("127.0.0.1",9501); 设置tcp服务器装机容量(太危言耸听了-其实就是设置属性) ...
- WebKitBrowser
WebKit.net是对WebKit的.Net封装, 使用它.net程序可以非常方便的集成和使用webkit作为加载网页的容器. 首先 下载WebKit.net 的bin文件. 然后 新建一个Wind ...