0

I just want to get the content part of the critic review in imdbpy without the rest of it is there a way to do this? or do I have to go through the text myself?

2 Answers2

0

provided that you know the movie ID, it's possible to parse just a single page, but beware that for the critic reviews page very little information are available; specifically only "metascore" and "metacritic url" are parsed.

An example, for the movie The Matrix (movieID 0133093)

>>> from imdb import IMDb
>>> ia = IMDb()
>>> m = ia.get_movie('0133093', info='critic_reviews')
>>> m['metascore']
'73'
>>> m['metacritic url']
'https://www.metacritic.com/movie/the-matrix?ftag=MCD-06-10aaa1c'
Davide Alberani
  • 1,061
  • 1
  • 18
  • 28
0

The easiest way to get critic review in imdbpy is to use get_movie_critic_reviews method which returns a dictionary.

theMatrix = ia.get_movie_critic_reviews('0133093')

Then you can look at the dictionary using the['data'] key for critic score and external url.

theMatrix['data']

#output:
{'metacritic url': 'https://www.metacritic.com/movie/the-matrix?ftag=MCD-06-10aaa1c',
 'metascore': '73'}

I don't understand what you mean by only the contents of the critic review. If you need the text from the external url then should use something like request with beautifulsoup I guess.

  • Yes, I meant I only want the text of the review itself not who wrote it and when, etc. anyways thanks for your help. – The overseer May 04 '20 at 15:50