From d5ed63462e10ec13f02f3d994b782d81e5a8308a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 4 Sep 2007 12:13:59 +0000 Subject: [PATCH] just try dont fail --- scrapeit/imdb.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scrapeit/imdb.py b/scrapeit/imdb.py index 9f700a4..2faa157 100644 --- a/scrapeit/imdb.py +++ b/scrapeit/imdb.py @@ -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 {}