electiondata
electiondata copied to clipboard
Add file type 'html'
import pandas as pd
url = “https://www.votecnmi.gov.mp/election-2020”
df_list = pd.read_html(url, match=“CANDIDATE”)
This code gives a list of data frames, one for each table in the html that has the word "CANDIDATE" in it. More generally, can use a regex to identify tables.
So can add a file_type=html option, with the usual other parameters.
Instead of pulling the html directly from the web server into pandas data frames, pull html into a file, documented in the usual way, and then process.