return outp
-def parse_html(html, lenient):
+def parse_html(html, args):
"""Use BeautifulSoup to parse the HTML"""
def clean_text(inp):
soup = BeautifulSoup(html, "html.parser")
outp, ths = [], []
- for table in soup.find_all("table"):
+ for i, table in enumerate(soup.find_all("table")):
ths = table.find_all("th")
if len(ths) != 2:
- if not lenient:
+ if not args.lenient:
raise Exception("lightcards: Headings malformed")
- else:
+ elif args.table == i:
try:
for x in table.find_all("tr"):
y = x.find_all("td")