时间:2021-05-22
step1. 找一个单词数据库
这里有一个13万个单词的
http://download.csdn.net/detail/u011004567/9675906
新建个mysql数据库words,导入words里面就行
step2.找个查询接口
这里我用的是http://apistore.baidu.com/astore/serviceinfo/27586.html
step3. 执行Python脚本
# -*- coding: utf-8 -*-'''域名注册查询'''__author__ = 'Jimmy'from sqlalchemy import Column, String,Integer, create_enginefrom sqlalchemy.orm import sessionmakerfrom sqlalchemy.ext.declarative import declarative_baseimport requestsimport jsonfrom html.parser import HTMLParserrequest_failure = []domain_available = []def writeToText(list,fn): file = open(fn, 'w') file.write(str(list)) file.close()class bodyJSON(HTMLParser): tag = False def handle_starttag(self, tag, attr): if tag == 'body': self.tag = True def handle_endtag(self, tag): if tag == 'body': self.tag = False def handle_data(self, data): if self.tag: self.data = data def getJSON(self): return self.dataBase = declarative_base()class Words(Base): # 表的名字: __tablename__ = 'words' # 表的结构: ID = Column(Integer(), primary_key=True) word = Column(String(100)) exchange = Column(String(1000)) voice = Column(String(1000)) times = Column(Integer())# 初始化数据库连接:engine = create_engine('mysql+mysqlconnector://root:846880@localhost:3306/words')# 创建DBSession类型:DBSession = sessionmaker(bind=engine)# 创建Session:session = DBSession()# 创建Query查询,filter是where条件,最后调用one()返回唯一行,如果调用all()则返回所有行:words = session.query(Words).filter(Words.ID).all()def searchInaaw8(words): length = len(words) print('====开始搜索...=====共%d个单词' %length) for i in range(0,length): word = words[i] url = 'http:// 查询超时' % (i, word.word)) request_failure.append(word.word) else: print('其他错误') request_failure.append(word.word) body.close() else: print('请求失败') request_failure.append(word.word) print('查询结束...') print('查询失败:') print(request_failure) writeToText(request_failure,'failure.text') print('未注册域名:') print(domain_available) writeToText(request_failure,'available.text')searchInaaw8(words)step4:放到阿里云就可以搞事情啦
以上所述是小编给大家介绍的Python批量查询域名是否被注册过,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
注册域名需要提前查询下该域名的基础信息,该域名是否被注册过,大家在查询域名时可以去一些服务商的网站。如何注册域名呢?域名查询注册需要注意什么问题?下面大家就来听
百度“域名查询工具”你会发现域名注册批量查询其实是比较大的需求,很多站长需要域名批量查询,域名批量,域名批量查询软件,域名查询工具,提供域名抢注平台域名注册查询
很多人在注册域名时会担心被提前抢注了,所以大家注册域名前一定要记得查询域名是否被注册了。域名注册机构查询怎么操作?域名注册有什么技巧?下面大家就跟随着一起来了解
注册域名程序流程网上都有介绍,很多域名注册服务商的网站还会提供域名一键查询的服务,可以查询到域名是否被注册。企业工商注册域名有什么步骤?域名注册有什么技巧?下面
域名信息查询的渠道比较多,很多注册服务商网站都可以直接查询。很多人在域名注册前都会查询下该域名是否被注册,域名信息查询系统有什么?域名注册一般多少钱?下面就来给