python convert html table to text

Solutions on MaxInterview for python convert html table to text by the best coders in the world

showing results for - "python convert html table to text"
Leon
16 May 2017
1import pandas as pd
2url = r'https://en.wikipedia.org/wiki/List_of_S%26P_500_companies'
3tables = pd.read_html(url) # Returns list of all tables on page
4sp500_table = tables[0] # Select table of interest