Here is the top answer, adapted for Python3 compatibility, and improved by stripping whitespace in cells:
from bs4 import BeautifulSoup
html = """
Tests
Failures
Success Rate
Average Time
Min Time
Max Time
103
24
76.70%
71 ms
0 ms
829 ms
"""
soup = BeautifulSoup(s, 'html.parser')
table = soup.find("table")
# The first tr contains the field names.
headings = [th.get_text().strip() for th in table.find("tr").find_all("th")]
print(headings)
datasets = []
for row in table.find_all("tr")[1:]:
dataset = dict(zip(headings, (td.get_text() for td in row.find_all("td"))))
datasets.append(dataset)
print(datasets)