Commits

Davide Alberani committed e20e02b

fix for empty nodes

Comments (0)

Files changed (1)

imdb/parser/http/bsouplxml/bsoupxpath.py

                 first = node[attribute_name]
                 return first.startswith(self.arguments[2])
         elif self.arguments[1] == 'text()':
-            first = node.contents[0]
+            first = node.contents and node.contents[0]
             if isinstance(first, BeautifulSoup.NavigableString):
                 return first.startswith(self.arguments[2])
         return False