Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在接收 mht 文件。我需要从这个文件中提取文本并继续一些业务逻辑。
有没有办法从 mht 文件中提取文本?
有没有办法将 MHT 转换为 html?
由于 MHTML 基本上是一个包含原始 HTML 文件及其所有资源的 MIME 文档,因此您可以使用 MIME 库来提取不同的部分。请注意,mht 文件内的 html 文件中的所有引用都可能引用嵌入文件的原始位置,您需要从 MIME 部分的 Content-Location 标头重建这些引用。