]> git.armaanb.net Git - lightcards.git/commitdiff
Only grab data from first table in file
authorArmaan Bhojwani <me@armaanb.net>
Tue, 9 Feb 2021 01:49:04 +0000 (20:49 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Tue, 9 Feb 2021 01:49:04 +0000 (20:49 -0500)
lightcards/parse.py

index f9ca3ee15afc6648ced65bd8d9436e911c19d4cf..a447485e4b046f4ab16bc67b251c8b140a41cba5 100644 (file)
@@ -22,7 +22,7 @@ def parse_html(html):
     def clean_text(inp):
         return inp.get_text().rstrip()
 
     def clean_text(inp):
         return inp.get_text().rstrip()
 
-    soup = BeautifulSoup(html, "html.parser")
+    soup = BeautifulSoup(html, "html.parser").find("table")
     outp = []
 
     for x in soup.find_all("tr"):
     outp = []
 
     for x in soup.find_all("tr"):