html = [
    '<html><body><p align="center"><b><font size="2">Table 1</font></b><table><tr><td>1. row 1, cell 1</td><td>1. row 1, cell 2</td></tr><tr><td>1. row 2, cell 1</td><td>1. row 2, cell 2</td></tr></table><p align="center"><b><font size="2">Table 2</font></b><table><tr><td>2. row 1, cell 1</td><td>2. row 1, cell 2</td></tr><tr><td>2. row 2, cell 1</td><td>2. row 2, cell 2</td></tr></table></html>'
    ]
soup = BeautifulSoup(''.join(html))
searchtext = re.compile('Table\\s+1', re.IGNORECASE)
foundtext = soup.find('p', text=searchtext)
table = foundtext.findNext('table')
rows = table.findAll('tr')
for tr in rows:
    cols = tr.findAll('td')
for td in cols:
    pass
How can I find a table after a text string using BeautifulSoup in Python?