Spider爬虫清洗数据(re方法)
import res0 = 'BOY and GIRL's1 = re.sub(r'BOY|GIRL', 'HUMAN', s0)print s1# HUMAN and HUMAN
替换方法。
Spider爬虫清洗数据(re方法)import res0 = 'BOY and GIRL's1 = re.sub(r'BOY|GIRL', 'HUMAN', s0)print s1
替换方法。
|