text = """
<html>
    <head>
    </head>
    <body>
        <table>
            <p>Table1</p>
            <table>
                <p>Extra Table</p>
            </table>
        </table>
        <table>
            <p>Table2</p>
        </table>
    </body>
</html>
"""
soup = BeautifulSoup(text)
tables = soup.find('body').find_all('table')
print(len(tables))
print(tables[1].text.strip())
tables = soup.find('body').find_all('table', recursive=False)
print(len(tables))
print(tables[1].text.strip())
BeautifulSoup in Python - getting the n-th tag of a type