📌  相关文章
📜  Beautifulsoup 删除空标签 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:15.476000             🧑  作者: Mango

代码示例1
[x.decompose() for x in soup.findAll(lambda tag: (not tag.contents or len(tag.get_text(strip=True)) <= 0) and not tag.name == 'br' )]