Reference: Python IMDbPY – Getting cover URL of the series - GeeksforGeeks
import imdbf = open('imdb-coverURL-20211029.txt' , 'w' ) ia = imdb.IMDb() code = ['0026778' ,'0033717' ,'0040246' ,'0047647' ,'0050539' ] for i in code: try : series = ia.get_movie(i) cover = series.data['cover url' ] f.write(cover) f.write('\n' ) except KeyError: f.write('NULL' ) f.write('\n' ) f.close() print('finished' )
Output in the txt file https://m.media-amazon.com/images/M/MV5BYTJmNmQxNGItNDNlMC00MDU3LWFhNzMtZDQ2NDY0ZTVkNjE3XkEyXkFqcGdeQXVyMDI2NDg0NQ@@._V1_SX101_CR0,0,101,150_.jpg https://m.media-amazon.com/images/M/MV5BYzg2MzBjNWUtMDgyZS00ZWFmLTljMDEtZmUxMTEwNGM4M2RlXkEyXkFqcGdeQXVyMDI2NDg0NQ@@._V1_SX101_CR0,0,101,150_.jpg https://m.media-amazon.com/images/M/MV5BNzNlYmY0ZTMtMGJmOC00OTY4LWE2ZDUtODIyOWI5ZmRkZDNiXkEyXkFqcGdeQXVyNDQ3NDM5OQ@@._V1_SY150_CR61,0,101,150_.jpg https://m.media-amazon.com/images/M/MV5BYTBlZGI3YmMtZGI1NC00OTA3LTk3OTYtYWE0YzhkYzkwZGNmXkEyXkFqcGdeQXVyMjI4MjA5MzA@._V1_SY150_CR0,0,101,150_.jpg https://m.media-amazon.com/images/M/MV5BOTYxNTI0MjA5OV5BMl5BanBnXkFtZTgwMDA1OTc5MTE@._V1_SX101_CR0,0,101,150_.jpg