Chinaunix首页 | 论坛 | 博客
  • 博客访问: 623585
  • 博文数量: 110
  • 博客积分: 3808
  • 博客等级: 中校
  • 技术积分: 1930
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-15 14:32
个人简介

声的伟大!

文章分类

全部博文(110)

文章存档

2014年(1)

2013年(2)

2012年(12)

2011年(81)

2010年(14)

分类: Python/Ruby

2014-01-02 10:38:27

#!/usr/bin/env python
# -*- coding: cp936 -*-
import time, easygui, re, urllib


def getHtml(url):
    page = urllib.urlopen(url)
    html = page.read()
    return html


def getContent(html):
    reg =r'setLmCode'
    contentreg = re.compile(reg)
    content = re.findall(contentreg, html)
    return content


def whileContent():
    while 1:
        html = getHtml("")
        content = getContent(html)
        time.sleep(1)
        return content


def tiXing(content):
    while 1:
        if len(content) >= 20:
            #print len(content)
            easygui.msgbox("Remind, Data update it !", title="Remind, Data update it !", ok_button="I know")
            time.sleep(1)
            break
            
        else:
            continue


content = whileContent()
tiXing(content)
阅读(1665) | 评论(0) | 转发(0) |
0

上一篇:分享一个Python爬虫小脚本

下一篇:没有了

给主人留下些什么吧!~~