学习编写爬虫(二)--------re/os库

正则表达式----(re库)css 下面是Python中正则表达式的一些匹配规则,图片资料来自CSDNhtml # -*- coding: utf-8 -*-pythonimport re #1.match() # 将正则表达式编译成Pattern对象,注意hello前面的r的意思是“原生字符串” pattern = re.compile(r'hello') # 使用re.match匹配文本,得到
相关文章
相关标签/搜索