[Python] How to change tag name with BeautifulSoup?

Discussão em 'Python' iniciado por Stack, Maio 15, 2025.

  1. Stack

    Stack Membro Participativo

    I am using python + BeautifulSoup to parse an HTML document.

    Now I need to replace all <h2 class="someclass"> elements in an HTML document, with <h1 class="someclass">.

    How can I change the tag name, without changing anything else in the document?

    Continue reading...

Compartilhe esta Página