Movie information (rating, runtimes, genres) missing

Issue #48 closed
Anonymous created an issue

Recently the retrieved information is incomplete.

imdb.VERSION '5.0' i = imdb.IMDb() r = i.search_movie("Minions (2015)") r[0]['kind'] u'movie' r[0]['rating'] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.7/site-packages/imdb/utils.py", line 1469, in getitem rawData = self.data[key] KeyError: 'rating' r[0].data {'kind': u'movie', 'year': 2015, 'title': u'Minions'}

Same for accessSystem='mobile'. Did IMDB change the HTML structure?

Comments (5)

  1. Luiz Mendes

    Have you tried doing an update before accessing these fields?

    imdb_result = ia.search_movie('Minions')[0]
    
    ia.update(imdb_result)
    
    print imdb_result['genre']
    

    [u'Animation', u'Comedy', u'Family']

  2. Thomas Wittek

    Oh yes, that's my fault. I changed my code to now use some information that is not available before update().

    It's not really clear from the documentation which fields I can access before update() and which ones I can use only after update(). Can I find that information anywhere? Or can I just try and whenever it fails call update() before?

    Thanks!

  3. Davide Alberani repo owner

    After a search operation, only minimal information are available: basically, the movie title. On an update (with no data set specified), the sections listed in imdb.Movie.Movie.default_info tuple are retrieved. To get a list of all available, see imdb.IMDb().get_movie_infoset()

  4. Log in to comment