#!/usr/bin/env python# @Time : 2017/9/5 15:31# @Author : qq:1960050004import urllibimport redef getallurl (): list2 = [] for i in range (1,31): url = "http://blog.51cto.com/artcommend/0/" +str (i) list2 = list2 + getyuanwenjian (URL) return List2def 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 urllistsif __name__ == ' __main__ ': for i in getallurl (): print (I[2].decode (' gb2312 '). Encode (' UTF8 ')), i[0]
[[email protected] ~/0910]# python 4.py >51cto.txt
[Fault resolution] Mysql-atlas never establish a connection from a library? http://chenx1242.blog.51cto.com/10430133/1911763
Linux Learning: Continuous Integration Chapter--maven installation and configuration of private libraries and local libraries -03 http://1754966750.blog.51cto.com/7455444/1911760
The Linux system makes the fortress machine through the SOCKS4/5 http://tongcheng.blog.51cto.com/6214144/1911476
VPN networking No worries 1-small and medium-sized VPN network building application record http://wangchunhai.blog.51cto.com/225186/1911462
Python error: No module named Setuptools solution http://mofansheng.blog.51cto.com/8792265/1911395
Windows Server R2 Domain control and exchange all in one http://rdsrv.blog.51cto.com/2996778/1911356
Rancher Container Network-floating IP Solution http://12462495.blog.51cto.com/12452495/1911306
NTFS file system for evaluation in Linux (historical version) http://zhangyu.blog.51cto.com/197148/1911271
VBS script to judge and get different content between two files http://gaowenlong.blog.51cto.com/451336/1911226
Introduction of several VPN networking methods http://wangchunhai.blog.51cto.com/225186/1911155
RABBITMQ Cluster http://navyaijm.blog.51cto.com/4647068/1911130
WeX5 objective problem software development and list component application and other typical questions http://zhuxianzhong.blog.51cto.com/157061/1910985
Nginx+tomcat implementation of the reverse proxy load balancing http://12059878.blog.51cto.com/12049878/1910911
Centos7 definition mariadb Source Yum Install the latest version of MARIADB http://gaowenlong.blog.51cto.com/451336/1910772
mysql+keepalived realization of dual-machine hot standby http://wuyunkeji.blog.51cto.com/12028005/1910709
Remember that a storage failure results in a database bad block processing process http://voidyao000.blog.51cto.com/12458042/1910603
Redis Cache Server (Nginx+tomcat+redis+mysql for session sharing) http://yw666.blog.51cto.com/11977292/1910451
Redis Cache Server (Nginx+tomcat+redis+mysql for session sharing) http://hexiaoshuai.blog.51cto.com/12156333/1910407
Another Linux service cannot be accessed via SSH under Linux http://gaowenlong.blog.51cto.com/451336/1910389
Memcache cache Server (Nginx+php+memcache+mysql) http://yw666.blog.51cto.com/11977292/1910163
Zabbix automatically discovers Oracle tablespaces and monitors their usage http://7424593.blog.51cto.com/7414593/1910111
Easy to use FPM package to make RPM package--linux http://215687833.blog.51cto.com/6724358/1910102
Zabbix server was hacked ... http://chenx1242.blog.51cto.com/10430133/1909923
E-Commerce Project summary http://sihai.blog.51cto.com/11115680/1909878
[[email protected] ~/0910]# python 4.py >51cto.txt
This article from the "owner, tomato to add eggs" blog, please be sure to keep this source http://jiandan.blog.51cto.com/5402129/1964306
Crawl 51cto Recommended Blog Python script