“Remova todas as tags HTML e texto da String Python” Respostas de código

Remova as tags HTML da String python

import re

def cleanhtml(raw_html):
  cleanr = re.compile('<.*?>')
  cleantext = re.sub(cleanr, '', raw_html)
  return cleantext
Tame Tapir

Remova todas as tags HTML e texto da String Python

string = "<p>frwefb</p>"
BeautifulSoup(string, "lxml").text
TheRubberDucky

Respostas semelhantes a “Remova todas as tags HTML e texto da String Python”

Perguntas semelhantes a “Remova todas as tags HTML e texto da String Python”

Mais respostas relacionadas para “Remova todas as tags HTML e texto da String Python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código