Getting different movie info from script than from python shell -


i have following script output cast of movie text document:

import imdb  ia = imdb.imdb() movie = ia.get_movie(0111161) cast = movie['cast'] text_file = open("cast.txt", "w") text_file.write("{0}".format(movie)) text_file.write("{0}".format(cast)) text_file.close() 

as can see scrape imdb website not database. when execute script in python shell (2.7.13) cast of 'the shawshank redemption', when execute command line (python myscript.py), cast of movie '29 acacia avenue', id=0037489. how can happen?

you should use

movie = ia.get_movie("0111161")

instead of

movie = ia.get_movie(0111161)


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -