Seems that this should be simple enough with the re
module (this is untested and from memory:
import re
test_str = """<span style=3D"text-decoration: line-through; color: rgb(156, 163, 173);">8=
/23/2017- Lorem ipsum dolor sit amet, fastidii sad.Vim graece&nb=
sp; tractatos"""
re.sub(r'=$', r'\n', test_str, flags=re.MULTILINE)
But since you are asking to parse it. What would you like to retrieve? Parsing usually means that you will extract structured data, therefore your input should be according to some grammar (seems like it is):
- first field is a date (in a certain format)
- second field a message
- third field (looks like thre's a third field): category
EDIT:
Most simple form:
import quopri
from HTMLParser import HTMLParser
test_str = """<span style=3D"text-decoration: line-through; color: rgb(156, 163, 173);">8=
/23/2017- Lorem ipsum dolor sit amet, fastidii sad.Vim graece&nb=
sp; tractatos"""
h = HTMLParser()
print h.unescape(quopri.decodestring(test_str))