如何将Word文档转换成Python中非常简单的html? [英] How do you convert a Word Document into very simple html in Python?

查看:709
本文介绍了如何将Word文档转换成Python中非常简单的html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我收到一个Word文档,我必须显示为一个网页。我目前正在使用Django的平板电脑来抓取MS Word生成的HTML内容。生成的html是相当凌乱的。有没有更好的方法可以使用Python生成非常简单的HTML来解决这个问题?

Every now and then I receive a Word Document that I have to display as a web page. I'm currently using Django's flatpages to achieve this by grabbing the html content generated by MS Word. The generated html is quite messy. Is there a better way that can generate very simple html to solve this issue using Python?

推荐答案

一个很好的解决方案涉及到上传到Google文件并从中导出html版本。 (必须有一个api?)

A good solution involves uploading into Google Docs and exporting the html version from it. (There must be an api for that?)

它做了这么多清理ups;道路上的美丽汤可以根据需要进行任何更改。它是地球上最强大和优雅的html解析库。

It does so many "clean ups"; Beautiful Soup down the road can be used to make any further changes, as appropriate. It is the most powerful and elegant html parsing library on the planet.

这是记者公司的已知标准。

This is a known standard for Journalist companies.

这篇关于如何将Word文档转换成Python中非常简单的html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆