摘要: python网络编程学习笔记(7):HTML和XHTML解析(HTMLParser、BeautifulSoup) 使用HTMLParser解析html HTMLParser.feed(data): 参数为需要解析的html字符串,调用后字符串开始被解析 阅读全文
posted @ 2017-03-21 17:03 在下刘彦直 阅读(222) 评论(0) 推荐(0) 编辑
摘要: from os import makedirs, unlink, sep #从os包中引入 makedirs.unlink,sep类from os.path import dirname, exists, isdir, splitext 从 os包中的path类中引入 dirmame exists 阅读全文
posted @ 2017-03-21 16:51 在下刘彦直 阅读(16084) 评论(0) 推荐(1) 编辑
摘要: ompile(pattern[,flags] ) 根据包含正则表达式的字符串创建模式对象 ,返回一个pattern对象,但是却没有对第二个参数flags进行介绍。第二个参数flags是匹配模式,可以使用按位或’|’表示同时生效,也可以在正则表达式字符串中指定。Pattern对象是不能直接实例化的,只 阅读全文
posted @ 2017-03-21 11:24 在下刘彦直 阅读(986) 评论(0) 推荐(0) 编辑
摘要: python 中 __init__ 与PHP中的构造函数相似__construct() 都具有初始化的作用。 1.python中的__init__是一个私有函数(方法),访问私有函数中的变量在python中用self,在PHP中用$this 2.在python类的定义中,一个函数(php叫方法)的参 阅读全文
posted @ 2017-03-21 10:42 在下刘彦直 阅读(1173) 评论(0) 推荐(0) 编辑