Python: convert json+html string to .doc

1.2k Views Asked by At

I'm writing a python script and i have to convert a rendered string(from a json with html inside) to a .docx file. I searched a lot in web but I'm still confused. I tried with python-docx but doesn't work well because wants docx input and he doesn't like this as a string:

<h1><span lessico='Questa' idx="0" testo="testo" show-modal="setModal()"     tables="updateTables(input)">Questa</span> <span lessico='&egrave;' idx="1" testo="testo" show-modal="setModal()" tables="updateTables(input)">&egrave;</span> <span lessico='una' idx="2" testo="testo" show-modal="setModal()" tables="updateTables(input)">una</span> <span lessico='domanda' idx="3" testo="testo" show-modal="setModal()" tables="updateTables(input)">domanda</span>...</h1>

<ul>

 <li>a scelta multipla</li>

 <li>con risposta aperta</li>

 <li>di tipo trova</li>

 <li>di associazione</li>

How can i convert this into a formatted .doc or .docx? possibly without getting mad :)

0

There are 0 best solutions below