I have the following tags:
<p>Projeto N <sup>o</sup> 00.000, DE 00 DE JANEIRO DE 0000.</p>
I would like to remove the tag by keeping the text. I needed it to look like this:
<p>Projeto N o 00.000, DE 00 DE JANEIRO DE 0000.</p>
I have the following tags:
<p>Projeto N <sup>o</sup> 00.000, DE 00 DE JANEIRO DE 0000.</p>
I would like to remove the tag by keeping the text. I needed it to look like this:
<p>Projeto N o 00.000, DE 00 DE JANEIRO DE 0000.</p>
You can use unwrap () :
from bs4 import BeautifulSoup as bs
soup = bs('<p>Projeto N <sup>o</sup> 00.000, DE 00 DE JANEIRO DE 0000.</p>')
soup.sup.unwrap() # <sup></sup>
print(soup) # <p>Projeto N o 00.000, DE 00 DE JANEIRO DE 0000.</p>