正则表达式

正达表达式:匹配    过滤

爬取编码:
两个步骤:爬取( import    urllib.request)
                数据清洗(import   re)
import  urllib.resquest    导入爬取模块
import  re     导入正则表达式

response=urllib.request.urlopen("http://t.cn/RttEZZa")
html=response.read()
html=html.decode("utf-8”)把爬取到的数据进行解码
ret=re.compile("百度一下")  编译   
print(ret.findall(html))     寻找所有

原文地址:https://www.cnblogs.com/liang715200/p/9990735.html