从具有多个页面的PDF中提取多个表

时间:2019-02-20 18:12:44

标签: python python-3.x spyder

嗨,我写了一些python代码,从具有多个页面的PDF中提取多个表,并将这些表放入xls文件中。该脚本已经运行了一段时间;我认为这是因为我的代码不好。这是我的代码:

from tabula import read_pdf

df = read_pdf("example.pdf", encoding='utf-8', spreadsheet=True, pages='all', multiple_tables=True)

for x in df:
    x.append(df, ignore_index=True)

writer = x.ExcelWriter('output.xls')
x.to_excel(writer,'sheet1')
writer.save()

提前致歉,因为我是Python的新手,任何建议将不胜感激。

0 个答案:

没有答案
相关问题