Tabula-py - pages argument

5
tabula.convert_into(filename_final, (filename_zero + '.csv'), 
                    output_format="csv", pages="all")

我该如何将第2页到最后一页进行转换?在第1页到其余页面之间,“区域”会发生变化。
我正在使用Python包装器tabula-py。
提前感谢您!
2个回答

6
根据README,pages参数可以是以下内容: pages (字符串、整数或整数列表,可选) - 可选值,用于指定要提取的页面。 - 它允许使用字符串、整数或整数列表。
例如:1、'1-2,3'、'all' 或 [1,2]。默认为 1。
所以我想你可以尝试一些类似于'2-99999'的东西。

2

Tabula-py - pages参数

from tabula import convert_into
table_file = r"Table.pdf"
output_csv = r"Op.csv"
#area[] have predefined area for each page from page number 2
for i in range(2, str(len(table_file))):
   j = i-2
   convert_into(table_file, output_csv, output_format='csv', lattice=False, stream=True, area=area[j], pages=i)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接