代码的持续改进
摘要:
#!/usr/bin/env python# -*- coding: utf-8 -*-#工厂模式def createDomTree(htmlStream,type='soup'): if type == "soup": return tnDomTreeWithSoup(htmlStream) if type == "lxml": return tnDomTreeWithlXml(htmlStream) return None #外部依赖的接口,它屏蔽了我具体使用的第三方库class tnDomTree: #public... 阅读全文
posted @ 2012-04-10 13:21 codestyle 阅读(228) 评论(0) 推荐(0)