ETL 的 Python 编码

问题描述 投票:0回答:1

我想从我的 pdf 页面中提取表格数量。但是当我执行程序函数时,它没有给出正确的表数量。它应该返回 2 个表,但它返回 1。我附上了函数代码的图片和 pdf 页面。

我尝试使用 tabula 包来阅读 pdf 页面。请为此提出一些更好的解决方案。我在过去两天内正在努力,但没有取得任何改进。谢谢[tables I wanna count and the code I wrote ](https://i.stack.imgur.com/xiM2e.jpg)

我尝试使用 tabula 包来阅读 pdf 页面。请为此提出一些更好的解决方案。我在过去 2 天内正在努力,但没有取得任何改进。

python etl
1个回答
0
投票

使用

pyPdf

获取页数的代码

import pyPdf
pdf_reader = pyPdf.PdfFileReader(open("your_file.pdf", mode='rb'))
pdf_total_pages = pdf_reader.getNumPages()
© www.soinside.com 2019 - 2024. All rights reserved.