我正在尝试使用以下代码从 OpenDocument 文本(odt)格式的圣经中提取希伯来语文本:
from odf import text, teletype
from odf.opendocument import load
textdoc = load("Heb-OT.odt")
texts = textdoc.getElementsByType(text.P)
alltext=teletype.extractText(texts[0])
print alltext
这不会打印任何我不知道出了什么问题的东西。文档很长(1000 页),但我需要全部搜索。