used stripped_strings for title and descriptions. default tip
authorFabien Ninoles <fabien@tzone.org>
Tue, 28 Oct 2014 11:51:49 -0400
changeset 15 053eabfead09
parent 14 f7112a0f9df7
used stripped_strings for title and descriptions.
update-hib.py
--- a/update-hib.py	Thu Aug 28 07:31:43 2014 -0400
+++ b/update-hib.py	Tue Oct 28 11:51:49 2014 -0400
@@ -45,7 +45,7 @@
         self.dltype = dltype
         ids = [attr for attr in soup["class"] if attr != "download"]
         button = soup.find(class_="flexbtn")
-        desc = button.span.string
+        desc = " ".join(button.span.stripped_strings)
         ids.extend(desc.split(" "))
         self.id = " ".join(ids)
         def cleanup(attr):
@@ -135,9 +135,7 @@
             classes = child["class"] if "class" in child.attrs else []
             if "gameinfo" in classes:
                 divTitle = child.find(class_="title")
-                if divTitle.a:
-                    divTitle = divTitle.a
-                self.title = divTitle.string.strip()
+                self.title = " ".join(divTitle.stripped_strings)
             elif "downloads" in classes:
                 logging.debug("Collecting downloadables for %s", self.title)
                 self.downloads.append(Downloads(child))