最近在给朋友弄个网站,网站基本弄好以后就要申请个域名,以前也接触过域名注册的,这次想真个拉风点的域名,结果。。。令人大失所望。
在不断重复的提交后,发现可以弄个程序检测一下有没有好点的域名,这样就不用人为输入域名了。然后就有了 下面的代码。
#!/bin/env python
#coding=gbk
import urllib
import urllib2
import time
'''关键字构造'''
def analysis(radix,keyword,lenSize):
global res_f
global res_e
if radix==10:
if keyword<radix:
res_f.append(keyword)
else:
res_f.append(keyword%radix)
analysis(radix,keyword/radix,lenSize)
else:
if keyword<radix:
res_e.append(keyword)
else:
res_e.append(keyword%radix)
analysis(radix,keyword/radix,lenSize)
'''form表单提交的地址,不好意思啊请求了几十万次'''
url = 'http://www.7data.com/domain_reg/'
'''域名中字符串的长度'''
chars_length = 3
'''域名中数字的长度'''
numbers_length = 1
print('auto check begin')
total_chars = 26**chars_length
total_numbers = 10**numbers_length
total_index = total_numbers*total_chars
i = 7
j = 26*26*11
'''这层循环是 对数字的遍历'''
while i<=7:
res_f=[]
analysis(10,i,numbers_length)
domain_f = ''
c = numbers_length-len(res_f)
index_1 = 0
'''这层循环是对英文字母的遍历'''
while index_1<c:
res_f.insert(len(res_f), 0)
index_1=index_1+1
for res_f_str in res_f:
domain_f=str(res_f_str)+domain_f
#print (domain_f)
while j<=total_chars:
res_e=[]
analysis(26,j,chars_length)
index_2 = 0
c2 = chars_length-len(res_e)
while index_2<c2:
res_e.insert(len(res_e), 0)
index_2=index_2+1
domain_e = ''
#print res_e
for res_e_str in res_e:
domain_e = chr(res_e_str+97)+domain_e
#print (j,':',domain_e)
'''要注册的域名'''
domainname=domain_e+domain_f
#domainname=domain_e
time.sleep(0.1)
values = {'module':'domainsearch','vrf':'','searchType':'IntDomain','action':'check','searchedDomainName':domainname,'suffix':'.com','imageField2.x':'41','imageField2.y':'17'}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
try:
#response=''
response = urllib2.urlopen(req)
except Exception,e:
print (Exception,'domain:',domainname,e)
hasResistflag = True
'''判断是否成功'''
for line in response:
if line.find('yes.jpg')>0:
hasResistflag=False
break
if not hasResistflag:
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'index:',j,'domains:',domainname,' --------------can regist--------------')
else:
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'index:',j,'domains:',domainname,' can not regist')
j=j+1
i=i+1
print('auto check end')
分享到:
相关推荐
基于Python实现检测域名是否被注册+源码,适合期末大作业、课程设计、项目开发。项目源码已经过严格测试,可以放心参考并在此基础上延申使用~ 基于Python实现检测域名是否被注册+源码,适合期末大作业、课程设计、...
用户管理是绝大部分Web网站都需要解决的问题。用户管理涉及到用户注册和登录。 用户注册相对简单,我们可以先通过API把用户注册这个功能实现了: _RE_MD5 = re.compile(r'^[0-9a-f]{32}$') @api @post('/api/users'...
python web开发.pdfpython web开发.pdfpython web开发.pdfpython web开发.pdfpython web开发.pdfpython web开发.pdfpython web开发.pdfpython web开发.pdf
python制作Web可视化页面,使用Streamlit库将一个Excel数据文件转换为一个Web页面,提供给所有人在线查看,项目一共有三个文件,程序、图片、Excel表格数据,内含源代码。
Python大作业基于python的web日志分析工具项目源码+注释.zipPython大作业基于python的web日志分析工具项目源码+注释.zipPython大作业基于python的web日志分析工具项目源码+注释.zipPython大作业基于python的web日志...
python web 案例 demo,python web 案例 demo,python web 案例 demo.
即时通讯:Python实现web版多人聊天室
本文给大家分享使用Python批量查询域名是否被注册过,非常不错,具有参考借鉴价值,需要的的朋友参考下吧
Python Django Web开发指南
想成为 Python web 开发工程师?想进入 Python 行业拿高薪?但还没入行? 别急,先看看 Python web 开发视频教 程。 千锋 Python 基础教程:http://pan.baidu.com/s/1qYTZiNE Python 课程教学高手晋级视频总目录: ...
pythonweb大作业,实现增删改查。分享pythonweb大作业,云认证平台登录,使用的是mongodb数据库。可查看运行教程 链接:https://blog.csdn.net/weixin_43960044/article/details/101012182
Python Web开发学习实录对应源代码
pythonweb设计教程课后答案_PythonWeb开发基础教程教学 ⼤纲 0 《 Python Web 开发基础教程》教学⼤纲 学 时: 66 代 码: 适⽤专业: 制 定: 审 核: 批 准: ⼀、课程的地位、性质和任务 Web 开发基础是普通⾼等...
基于python3编写的web后台管理系统,基于layui采用Django框架实现完整的后台管理系统,包含菜单权限、机构权限、数据权限等,功能齐全。 基于python3编写的web后台管理系统,基于layui采用Django框架实现完整的...
FlaskWeb开发:基于Python的Web应用开发实战
Python Web开发实战 前端工程师必看书目
python-flask框架,实时监控本地系统的cpu、内存使用率,用psutil获得系统进程信息,flask web框架,ajax局部刷新获得数据,echarts图表显示,sqlalchemy连接mysql数据库,只要把数据库连接换成自己的就可以用了
Python Web 框架,第 1 部分 使用 Django 和 Python 开发 Web 站点.doc
python web数据采集显示 matplot插件进行显示 刷新平滑
Flask是一个使用 Python 编写的轻量级 Web 应用框架。其 WSGI 工具箱采用 Werkzeug ,模板引擎则使用 Jinja2 。Flask使用 BSD 授权。