程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

Pypandoc python html to docx

发布于2025-01-02 16:29     阅读(1029)     评论(0)     点赞(7)     收藏(1)


I have an html file and I want to convert it to .docx file. I used the pypandoc library and it's pretty good, but there is a trouble that tables in the file aren't converted and are obtained like text. If someone knows how to fix this, I will be grateful if u tell me how to.

I've tried this:

import pypandoc

output = pypandoc.convert_file('test3.html', 'docx', outputfile=f'output.doc')

and got this table: output table from this table: input table


解决方案


I find it difficult to reproduce your problem with the information given.Could you please provide a minimal reproducible example (i.e. giving the content of test3.html)?

Please also referr to this.



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:https://www.pythonheidong.com/blog/article/2046678/f1ee3b6d7b0fba9b40cd/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

7 0
收藏该文
已收藏

评论内容:(最多支持255个字符)