Scrape tables into dataframe with BeautifulSoup
Pandas already has a built-in method to convert the table on the web to a dataframe:
table = soup.find_all('table')
df = pd.read_html(str(table))[0]
Try this
l = []
for tr in table_rows:
td = tr.find_all('td')
row = [tr.text for tr in td]
l.append(row)
pd.DataFrame(l, columns=["A", "B", ...])