08 2016 档案

摘要:# -*- coding:utf-8 -*- import urllib import urllib2 import re #处理页面标签类 class Tool: #去除img标签,7位长空格 removeImg = re.compile('<img.*?>| {7}|') #删除超链接标签 re 阅读全文
posted @ 2016-08-12 15:26 vxee 阅读(196) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-08-04 22:10 vxee 阅读(118) 评论(0) 推荐(0)
摘要:本篇目标 1.抓取糗事百科热门段子 2.过滤带有图片的段子 3.实现每按一次回车显示一个段子的发布时间,发布人,段子内容,点赞数。 糗事百科是不需要登录的,所以也没必要用到Cookie,另外糗事百科有的段子是附图的,我们把图抓下来图片不便于显示,那么我们就尝试过滤掉有图的段子吧。 好,现在我们尝试抓 阅读全文
posted @ 2016-08-02 22:00 vxee 阅读(293) 评论(0) 推荐(0)
摘要:import random code = [] for i in range(6): if i == random.randint(1,5): code.append(str(random.randint(0,9))) else: temp = random.randint(65,90) code.append(chr(temp... 阅读全文
posted @ 2016-08-02 09:11 vxee 阅读(171) 评论(0) 推荐(0)