Error in parsing the HTML Tables

My code is
table_header= tables.findAll(‘th’)
print(len(header))

Error is
AttributeError: ResultSet object has no attribute ‘findAll’. You’re probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?

table_header is list consist f more than one item, so first you need select one item of the list to use finAll attribute
for your code try the following
table_header=table_header[0]