我需要提取包含关键字的pptx文件的页码和名称。我可以用1 pptx做到这一点,并尝试了一些方法,但似乎无济于事。我在这里添加代码
prs = Presentation('Informe Final.pptx')
print('Documento: '+ files[0].replace('.pptx',''))
slides = prs.slides
for slide in prs.slides:
for shape in slide.shapes:
if not shape.has_text_frame:
continue
for p in shape.text_frame.paragraphs:
for run in p.runs:
if 'driver' in run.text.lower():
print('Diapositiva numero ' + str(slides.index(slide)+1))