So I'm trying to take the name of an actor and get the cast list of each
movie he's in. I thought the movie object might have a cast attribute, but
no luck. I'm not entirely sure how to do this, but the way I thought (see
below) is throwing an error. This is running with a CVS version (albeit not
the latest) of imdbpy on Ubuntu Edgy with python2.4. Is there a different
way to do this? I still don't really understand the update method.

from imdb import IMDb
i = IMDb()
resList = i.search_person(u'edward norton')
root = resList[0]
i.update(root)
mov_list = root['actor']
cur_mov = mov_list[0]
i.update(cur_mov)
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "/usr/lib/python2.4/site-packages/imdb/__init__.py", line 297, in
update
   ret = method(mopID)
 File "/usr/lib/python2.4/site-packages/imdb/parser/http/__init__.py", line
287, in get_movie_main
   return movie_parser.parse(cont, mdparse=self._mdparse)
 File "/usr/lib/python2.4/site-packages/imdb/parser/http/utils.py", line
452, in parse
   self.feed(html_string)
 File "/usr/lib/python2.4/sgmllib.py", line 95, in feed
   self.goahead(0)
 File "/usr/lib/python2.4/sgmllib.py", line 129, in goahead
   k = self.parse_starttag(i)
 File "/usr/lib/python2.4/sgmllib.py", line 283, in parse_starttag
   self.finish_starttag(tag, attrs)
 File "/usr/lib/python2.4/sgmllib.py", line 317, in finish_starttag
   self.handle_starttag(tag, method, attrs)
 File "/usr/lib/python2.4/site-packages/imdb/parser/http/utils.py", line
404, in handle_starttag
   method(attrs)
 File "/usr/lib/python2.4/site-packages/imdb/parser/http/movieParser.py",
line 378, in do_br
   self._add_info()
 File "/usr/lib/python2.4/site-packages/imdb/parser/http/movieParser.py",
line 365, in _add_info
   self._data.setdefault(self._section, []).append(ct)
AttributeError: 'unicode' object has no attribute 'append'

Thanks,
Jon
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Imdbpy-devel mailing list
Imdbpy-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel

Reply via email to