下面采用两种方式:
1.camlot模块
import camelot
import pandas as pd
#显示所有列
pd.set_option('display.max_columns', None)
#显示所有行
pd.set_option('display.max_rows', None)
tables = camelot.read_pdf("02.pdf",flavor='stream')
tables
df=tables[0].df
df
#可视化图纸
plt = camelot.plot(tables[0],kind='contour')
plt.show()
#取固定区域表格
tables = camelot.read_pdf("02.pdf",flavor='stream',table_areas=["640,560,740,350"])
tables[0].df
2.Tabula
3.结言
1. 试了pdfplumber,也不咋地
2. camlot和tabula效果差不多(怀疑就是同一个代码,哈哈)
3. 期待更好的方法。。