下载360最新的安装包,下载360安装包,从360官网上下载最新的
下载360最新的安装包,下载360安装包,从360官网上下载最新的
从360官网上下载最新的安装包,一个基础包,一个全包,用户可以自已修改,小脚本很简单,主要是练习一下正则匹配,与简单的urllib库的应用
#coding: utf8import urllib,reimport osdef getLastinstall(): page = urllib.urlopen(r'http://sd.360.cn/download_center.html') html = page.read() page.close() rematch = r'http://down.360.cn/360sd/360sd_se_(.*?)exe' replusmatch = r'http://down.360.cn/360sd/360sd_plus_(.*?)exe' stdname = '360sd_'+(str(re.compile(rematch).findall(html)[0]))+'exe' downurlstd = r'http://down.360.cn/360sd/360sd_'+(str(re.compile(rematch).findall(html)[0]))+'exe' powname = '360sd_plus_'+(str(re.compile(replusmatch).findall(html)[0]))+'exe' downurlpow = r'http://down.360.cn/360sd/360sd_plus_'+(str(re.compile(replusmatch).findall(html)[0]))+'exe' localpath = os.getcwd()+r'/installpack' if not (os.path.isfile(stdname) and os.path.isfile(powname)): if not os.path.isdir('installpack'): os.makedirs('installpack') urllib.urlretrieve(downurlstd,localpath+'/'+stdname) urllib.urlretrieve(downurlpow,localpath+'/'+powname) else: print '目录中已经是线上最新版杀毒安装程序'if __name__ =='__main__': getLastinstall()#该片段来自于http://byrx.net
相关内容
- Python的logging模块封装,pythonlogging模块,使得logging模块用
- 排序,,q = lambda x
- Extended Euclid Algorithm,euclidalgorithm,d = gcd(a, b
- python实现的类文件接口的gopher客户端,,import socke
- python操作sqlite的CRUD,pythonsqlitecrud,import sqlit
- 在centos上安装python pip和easy_install,centoseasy_install,在c
- centos安装 python-dev包提示No package python-dev available,cen
- 初识聚类算法: 基本K均值,初识聚类k均值,基本K均值
- python与计算物理:迭代法解线性方程组,python计算物理
- 快速登录网络设备,,用于快速登录路由器,交换
评论关闭