kenghy 发表于 2020-9-8 23:08:02

如何利用Python在pdf文档中寻找关键词出现的页码?

求助:在网上找到一篇可以检索 的贴子。但导入pdfminer老是出错,搞了两天,快搞疯了{:5_100:}

kenghy 发表于 2020-9-8 23:13:20

python 3.7
pip install pdfminer.six

from pdfminer.converter import PDFPageAggregator
from pdfminer.pdfparser import PDFParser,PDFDocument
from pdfminer.layout import LTTextBoxHorizontal, LAParams
from pdfminer.pdfinterp import PDFTextExtractionNotAllowed
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter

报错:
ImportError: cannot import name 'PDFDocument' from 'pdfminer.pdfparser' (C:\ProgramData\Anaconda3\lib\site-packages\pdfminer\pdfparser.py)
页: [1]
查看完整版本: 如何利用Python在pdf文档中寻找关键词出现的页码?