How to extract text from pdf in Python 3.7

后端 未结 10 1246
后悔当初
后悔当初 2020-12-29 10:19

I am trying to extract text from a PDF file using Python. My main goal is I am trying to create a program that reads a bank statement and extracts its text to update an exce

10条回答
  •  孤独总比滥情好
    2020-12-29 11:07

    import pdftables_api
    import os
    
    c = pdftables_api.Client('MY-API-KEY')
    
    file_path = "C:\\Users\\MyName\\Documents\\PDFTablesCode\\"
    
    for file in os.listdir(file_path):
        if file.endswith(".pdf"):
            c.xlsx(os.path.join(file_path,file), file+'.xlsx')
    

    Go to https://pdftables.com to get an API key.

    CSV, format=csv

    XML, format=xml

    HTML, format=html

    XLSX, format=xlsx-single, format=xlsx-multiple

提交回复
热议问题