I am using IMdbpy and I want to extract the top ten movies from a given genre.
I have written following code:
code = "0133093"
# getting information
series = ia.get_movie(code)
# getting gerne of the series
genre = series.data['genres']
Based on the above output I am getting Action and Sci-fi as a genre.
Now how to get top 10 movies of either action or Sci-fi or both genre.
I got this code but this code gives the top 20 movie and genres that differs. I want top 10 movies based on either Action or Sci-fi.
import imdb
ia = imdb.IMDb()
top250 = ia.get_top250_movies()
for movie_count in range(0, 20):
movie = ia.get_movie(top250[movie_count].movieID)
print(movie['title'])print(*movie['genres'], sep=", ")