Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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' )]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #beautifulsoup #remove #empty #tags
ADD COMMENT
Topic
Name
5+6 =