OiO.lk Blog HTML Pypandoc python html to docx
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:

from this table:



You need to sign in to view this answers

Exit mobile version