Ayush ShaZz
Ayush ShaZz

Reputation: 346

Camelot is reading only the first page of the pdf

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

Its reading only the first page. Someone please help me out

Upvotes: 13

Views: 10856

Answers (3)

Bharath Kumar B
Bharath Kumar B

Reputation: 1

Found this on Github. Worked for me:

import pandas as pd

import camelot

FileName="Filepath"

DF3=camelot.read_pdf(FileName,multiple_tables=True,options="--pages 'all'", lattice= True)

print DF3

Upvotes: 0

Richtea88
Richtea88

Reputation: 121

If you want to read all the pages in a pdf then use:

camelot.read_pdf('your.pdf', pages='all')

Upvotes: 10

Kamuish
Kamuish

Reputation: 118

By default Camelot only uses the first page, see here: https://camelot-py.readthedocs.io/en/master/user/quickstart.html

From the link, you can do multiple pages:

camelot.read_pdf('your.pdf', pages='1,2,3')

Or, if you want to use them all:

camelot.read_pdf('your.pdf',pages=1,4-10,20-end )

Upvotes: 7

Related Questions