我已經使用Jython解析了電子郵件消息以獲取電子郵件消息正文值。 現在我有身體的價值,我想從中提取以下文本。Python/Jython解析電子郵件
正文包含文本,我想以提取下列文字:
有在體內發現行:
[type]: mail
[category]: Values
[service]: testing
[description]: Testing out automapping of email
Line break Testing out automapping of email
Line break Testing out automapping of email
現在我想提取[描述後,所有的值]: 這可能嗎? 我嘗試這樣做:
desc = '[description]:'
res = findall("{}.*".format(desc), body)[0]
你說,體內含有HTML **和* *文本。 HTML在哪裏? – Squall
對不起更新的問題: – user2023042
確定使用這個:res = findall(「%s。*」%'[description]:',body)我只得到一行..我如何包含文本的所有行? – user2023042