fixed bug wherein empty elements would make get_venue() crash

This commit is contained in:
Andrew Moss 2013-12-27 10:08:50 +00:00
parent 5709e5bc51
commit f9cb8786f6

View file

@ -3648,8 +3648,8 @@ def _extract_element_tree(node, index = 0):
targetDict[node.tagName] = {} targetDict[node.tagName] = {}
_recurse_build_tree(node, targetDict[node.tagName]) _recurse_build_tree(node, targetDict[node.tagName])
else: else:
targetDict[node.tagName] = _unescape_htmlentity(node.firstChild.data.strip()) val = None if node.firstChild is None else _unescape_htmlentity(node.firstChild.data.strip())
targetDict[node.tagName] = val
return targetDict return targetDict
return _recurse_build_tree(node, {}) return _recurse_build_tree(node, {})