學習編寫爬蟲(二)--------re/os庫

正則表達式----(re庫)css 下面是Python中正則表達式的一些匹配規則,圖片資料來自CSDNhtml # -*- coding: utf-8 -*-pythonimport re #1.match() # 將正則表達式編譯成Pattern對象,注意hello前面的r的意思是「原生字符串」 pattern = re.compile(r'hello') # 使用re.match匹配文本,得到
相關文章
相關標籤/搜索