Beautifulsoup extracts html, Filter line feeds and spaces, but retains the tag content

use Beautifulsoup to parse html content, extract the body of a tag content, need line breaks and spaces in Filter, but to retain the html tag, how to solve

original content
clipboard.png

clipboard.png

keep the html tag, spaces and line breaks in Filter

Mar.28,2021

solved
use. Replace ('nasty,')


is there any sample content? the basic idea can be achieved by string-related operations such as replace or regular


upstairs positive solution, replace, or re


see the first floor

.
Menu