试试这个:
with open('aa.html') as f: s=f.read()import res1=re.sub('<.+?>',' ',s)with open('bb.html') as wf: wf.write(s1)