just try dont fail

This commit is contained in:
j 2007-09-04 12:13:59 +00:00
parent 7bb7cf8beb
commit d5ed63462e
1 changed files with 7 additions and 1 deletions

View File

@ -473,7 +473,13 @@ class IMDb:
ol = ol[0]
ret = {}
for li in ol('li'):
ret[li('a')[0].get('href')] = li('a')[0].contents[0]
try:
a = li('a')[0]
href = a.get('href')
txt = a.contents[0]
ret[href] = txt
except:
pass
return ret
return {}