- soup = BeautifulSoup(html, "html.parser").find_all("table")
- outp = []
-
- for table in soup:
- try:
- for x in table.find_all("tr"):
- y = x.find_all("td")
- if y:
- outp.append(Card(tuple([clean_text(z) for z in y])))
- except AttributeError:
- raise Exception("lightcards: No table found") from None