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]

Leave a Comment