If you want to quickly extract a table on a website and turn it into a pandas DataFrame, use pd.read_html. In the code above, I extracted the table from a Wikipedia page in one line of code.
pd.read_html