Answers for "beautifulsoup remove empty tags"

0

beautifulsoup remove empty tags

[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' )]
Posted by: Guest on July-21-2020

Python Answers by Framework

Browse Popular Code Answers by Language