Convert
to end line

前端 未结 6 1817
别跟我提以往
别跟我提以往 2020-12-08 19:00

I\'m trying to extract some text using BeautifulSoup. I\'m using get_text() function for this purpose.

My problem is that the text contain

6条回答
  •  隐瞒了意图╮
    2020-12-08 19:51

    You can do this using the BeautifulSoup object itself, or any element of it:

    for br in soup.find_all("br"):
        br.replace_with("\n")
    

提交回复
热议问题