Sep-05-2023, 11:58 AM
hello again
ok so im trying to generate the top 10 best movies from imdb. i have the code below that i found in a tutorial but as you can see under the code the variable is empty. I tried both Cinemagoer class and IMDb class but they both just end up having the same problem
ok so im trying to generate the top 10 best movies from imdb. i have the code below that i found in a tutorial but as you can see under the code the variable is empty. I tried both Cinemagoer class and IMDb class but they both just end up having the same problem
import imdb cg=imdb.Cinemagoer() top=cg.get_top250_movies() for i in range(10): print(top[i]["title"])
Error:Traceback (most recent call last):
File "C:\Users\giorg\PycharmProjects\pythonProject2\get_250_filns_imdb\main.py", line 7, in <module>
print(top[i]["title"])
IndexError: list index out of range
when i try printing the "top" variable it appears as an empty list which is why im getting the indexerror you see above