Camelot 只阅读 pdf 的第一页

Ayu*_*aZz 12 python python-camelot

tables = camelot.read_pdf(r"C:\Users\Ayush ShaZz\Desktop\Code_Python\FoodCaloriesList.pdf")
for table in tables:
    print(table.df)
Run Code Online (Sandbox Code Playgroud)

它只阅读第一页。请有人帮助我

小智 9

如果您想阅读 pdf 中的所有页面,请使用:

camelot.read_pdf('your.pdf', pages='all')
Run Code Online (Sandbox Code Playgroud)


小智 7

默认情况下,Camelot 仅使用第一页,请参见此处: https: //camelot-py.readthedocs.io/en/master/user/quickstart.html

从链接中,您可以创建多个页面:

camelot.read_pdf('your.pdf', pages='1,2,3')
Run Code Online (Sandbox Code Playgroud)

或者,如果您想全部使用它们:

camelot.read_pdf('your.pdf',pages=1,4-10,20-end )
Run Code Online (Sandbox Code Playgroud)