#!/usr/bin/env python # @Time : 2017/9/5 15:31 # @Author : qq:1960050004 import urllib import re def getAllUrl(): list2 = [] for i in range(1,31): url = "http://blog.51cto.com/artcommend/0/"+str(i) list2 = list2 + getYuanWenJian(url) return list2 def getYuanWenJian(url): page = urllib.urlopen(url).read() # reg = r‘href="(.*?\d)" china‘ reg = r‘href="(.*?\d)" china(.*?)\>(.*?)\<‘ urllist = re.compile(reg) urllists = re.findall(urllist, page) return urllists if __name__ == ‘__main__‘: for i in getAllUrl(): print (i[2].decode(‘gb2312‘).encode(‘utf8‘)),i[0]
[[email protected] ~/0910]# python 4.py >51cto.txt
[故障解决]Mysql-Atlas从库始终没有建立连接怎么办? http://chenx1242.blog.51cto.com/10430133/1911763
linux学习:持续集成篇--Maven私有库和本地库的安装与配置-03 http://1754966750.blog.51cto.com/7455444/1911760
Linux系统通过SOCKS4/5做堡垒机 http://tongcheng.blog.51cto.com/6214144/1911476
VPN组网不用愁之1-中小企业VPN网络组建应用实录 http://wangchunhai.blog.51cto.com/225186/1911462
python错误:No module named setuptools 解决方法 http://mofansheng.blog.51cto.com/8792265/1911395
Windows Server 2012 R2域控和Exchange 2016 ALL IN ONE http://rdsrv.blog.51cto.com/2996778/1911356
Rancher容器网络-Floating IP解决方案 http://12462495.blog.51cto.com/12452495/1911306
linux中生成考核用的NTFS文件系统(历史版本) http://zhangyu.blog.51cto.com/197148/1911271
VBS脚本判断及获取两个文件之间的不同内容 http://gaowenlong.blog.51cto.com/451336/1911226
几种VPN组网方式介绍 http://wangchunhai.blog.51cto.com/225186/1911155
RabbitMQ集群 http://navyaijm.blog.51cto.com/4647068/1911130
WeX5客观题软件开发与list组件应用等典型疑问 http://zhuxianzhong.blog.51cto.com/157061/1910985
nginx+tomcat实现反向代理的负载均衡 http://12059878.blog.51cto.com/12049878/1910911
Centos7 下定义MariaDB源Yum安装最新版本的MariaDB http://gaowenlong.blog.51cto.com/451336/1910772
MySQL+Keepalived实现双机热备 http://wuyunkeji.blog.51cto.com/12028005/1910709
记一次存储故障导致数据库坏块处理过程 http://voidyao000.blog.51cto.com/12458042/1910603
redis缓存服务器(Nginx+Tomcat+redis+MySQL实现session会话共享) http://yw666.blog.51cto.com/11977292/1910451
redis缓存服务器(nginx+tomcat+redis+mysql实现session会话共享) http://hexiaoshuai.blog.51cto.com/12156333/1910407
Linux下通过SSH无法访问另外一台Linux服务 http://gaowenlong.blog.51cto.com/451336/1910389
memcache缓存服务器(Nginx+PHP+memcache+MySQL) http://yw666.blog.51cto.com/11977292/1910163
zabbix自动发现oracle表空间并监控其使用率 http://7424593.blog.51cto.com/7414593/1910111
轻松使用Fpm封装制作Rpm包 --Linux http://215687833.blog.51cto.com/6724358/1910102
Zabbix server被入侵了... http://chenx1242.blog.51cto.com/10430133/1909923
电商项目总结 http://sihai.blog.51cto.com/11115680/1909878
[[email protected] ~/0910]# python 4.py >51cto.txt