Reputation: 171
I have a document in the .odt file,
I just want to extract the titles of this document :
in other words , I want to extract the "sentenses " or in others words "the "line" which are in bold in this documentdocument.odt :
my code :
from odf.opendocument import load
from odf import text
from odf import teletype
doc = load('result.odt')
for paragraph in doc.getElementsByType(text.Span):
print (paragraph.getAttribute('stylename'))
print(paragraph)
the document is in attached file :
Thank you for your help !
Regards,
Upvotes: 0
Views: 527