fix wikipedia parser
This commit is contained in:
parent
037b67471b
commit
0ad7a088bf
1 changed files with 5 additions and 1 deletions
|
@ -65,6 +65,10 @@ def get_movie_data(wikipedia_url):
|
||||||
key = key.strip()
|
key = key.strip()
|
||||||
if value:
|
if value:
|
||||||
if key in filmbox:
|
if key in filmbox:
|
||||||
|
print key, value, filmbox
|
||||||
|
if isinstance(value, list) and isinstance(filmbox[key], basestring):
|
||||||
|
filmbox[key] = [filmbox[key]] + value
|
||||||
|
else:
|
||||||
filmbox[key] += value
|
filmbox[key] += value
|
||||||
if isinstance(filmbox[key], list):
|
if isinstance(filmbox[key], list):
|
||||||
filmbox[key] = [k for k in filmbox[key] if k]
|
filmbox[key] = [k for k in filmbox[key] if k]
|
||||||
|
|
Loading…
Reference in a new issue