]> git.tdb.fi Git - poefilter.git/commitdiff
Minor tweaks to the item scraping script
authorMikko Rasa <tdb@tdb.fi>
Fri, 17 Aug 2018 15:17:16 +0000 (18:17 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 17 Aug 2018 15:17:16 +0000 (18:17 +0300)
scrape-item-data.py

index c592ff48d1c1d437a3d86b1ebb300206c7677797..84def9232b6cf2ddaedc1e3353ed00e17d82f58a 100755 (executable)
@@ -136,7 +136,8 @@ class ItemDataParser(html.parser.HTMLParser):
                        self.mod_names = []
                elif tag=="td":
                        self.column += 1
-                       self.in_cell = True
+                       if self.in_items_table:
+                               self.in_cell = True
                elif tag=="h1":
                        self.in_heading = True
 
@@ -166,7 +167,7 @@ class ItemDataParser(html.parser.HTMLParser):
                        if self.current_heading=="Staff":
                                self.current_heading = "Stave"
                        self.headings.append(self.current_heading)
-               elif self.in_items_table and self.in_cell:
+               elif self.in_cell:
                        if self.mod_row:
                                if self.column==1:
                                        self.mod_names.append(data)