hello!python!
摘要: #coding:utf-8import urllib2import sysimport redef getPage(url,offset = '0'): realurl = "%s%s%s" %(url,offset,'.shtml') print realurl resp = urllib2.urlopen(realurl) content = resp.read() #print content p = re.compile(']+>') p1=re.compile('p]+>') print 阅读全文
posted @ 2014-02-07 16:04 你坚持了吗 阅读(826) 评论(0) 推荐(0) 编辑
摘要: python RE模块转自:http://blog.chinaunix.net/uid-17260303-id-2811331.html#coding:utf-8import re#match只是从头匹配字符串,search是匹配字符串的任何位置#group都是从1开始的而不是0re.match("c", "abcdef") # Nomatch Falsere.search("c", "abcdef") # Match Truereobj =re.compile("^abw*")#reobj是一 阅读全文
posted @ 2014-02-07 15:28 你坚持了吗 阅读(673) 评论(0) 推荐(0) 编辑
hello!python!