from bs4 import BeautifulSoup import urllib.request import re moduel =re.compile('<.*?>') st = '<div id="wordm" style="line-height:150%;font-size:14px;font-weight:bold;">n. 名称,名字;姓名;名誉<br/>vt. 命名,任命;指定;称呼;提名;叫出<br/>adj. 姓名的;据以取名的<br/></div>' info = re.sub(moduel, ' ', st) print(info)
效果: