.read_html() creates a list of .read_html() in the HTML source, there can be several tables), getting the desired index. In your case, there is one data frame:
dfs = pd.read_html(url) df = dfs[0] print(df)
Note that if there is no table in the HTML source, it will throw an error and will never produce an empty list.
source share