text-mine PDF files with Python?

末鹿安然 提交于 2019-11-30 15:48:50

问题


Is there a package/library for python that would allow me to open a PDF, and search the text for certain words?


回答1:


Using PyPdf2 you can use extractText() method to extract pdf text and work on it.

Update: Changed text to refer to PyPdf2, thanks to @Aditya Kumar for heads up.




回答2:


I don't think you can do it in one step, but you can certainly get the text out of a pdf with pdfminer. Then you can apply whatever text search to that recovered data.



来源:https://stackoverflow.com/questions/1672202/text-mine-pdf-files-with-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!