def unwrapUseless(soup):
# unwrap??????
for a in soup.select('a'):
a.unwrap()
for a in soup.select('b'):
a.unwrap()
for a in soup.select('font'):
a.unwrap()
for a in soup.select('span'):
a.unwrap()
comments = soup.findAll(text=lambda text: isinstance(text, Comment))
[comment.extract() for comment in comments]
评论列表
文章目录