使用ews java api将html表解析为纯文本

使用ews java api将html表解析为纯文本,java,groovy,outlook,exchangewebservices,ewsjavaapi,Java,Groovy,Outlook,Exchangewebservices,Ewsjavaapi,我使用ews java api从Exchange服务器获取电子邮件。因为我不想处理html,所以我使用ews功能将正文解析为文本 PropertySet propertySet = new PropertySet(BasePropertySet.FirstClassProperties) propertySet.requestedBodyType = BodyType.Text 这在大多数情况下都很有效。但是,对于某些html表,每列之后都会出现换行符,例如 ColName1 ColNam

我使用ews java api从Exchange服务器获取电子邮件。因为我不想处理html,所以我使用ews功能将正文解析为文本

 PropertySet propertySet = new PropertySet(BasePropertySet.FirstClassProperties)
 propertySet.requestedBodyType = BodyType.Text
这在大多数情况下都很有效。但是,对于某些html表,每列之后都会出现换行符,例如

ColName1 ColName2 A. B
为什么不从HTML中获取表(例如,使用jsoup)?仍然高度依赖于邮件的种类,但至少你不必受文本转换器的摆布,这会导致你仍然需要解析。为什么不从HTML中获取表格(例如使用jsoup)?仍然高度依赖于邮件的种类,但至少您不需要依赖于某些文本转换器,您仍然需要解析这些文本转换器的结果。