October 22, 2024
Chicago 12, Melborne City, USA
HTML

Pypandoc python html to docx


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



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video