Issue
I'm trying to extract some text using BeautifulSoup
. I'm using get_text()
function for this purpose.
My problem is that the text contains </br>
tags and I need to convert them to end lines. how can I do this?
Solution
A regex should do the trick.
import re
s = re.sub('<br\s*?>', '\n', yourTextHere)
Hope this helps!
Answered By - mbinette
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.