###################################################################### # URL: https://github.com/alberanid/imdbpy # # install-best: pip install git+https://github.com/alberanid/imdbpy # # install: pip install imdbpy # ###################################################################### # Davide Alberani's most excellent module from imdb import IMDb import datetime # lindsay wagner '0905993' # burt lancaster '0000044' # helen hunt '0000166' strPersonID = '0000166' # fetch an actor's filmography and dump to webpage with checkmark support def Create_Actor_Filmography(imdbID, webPageName): # create an instance of the IMDb class objIMDB = IMDb() # open the file objWebPage = open(webPageName + '.htm', 'w') # get a person - say, Lindsay Wagner ('0905993'). We just want the filmography object objActor = objIMDB.get_person(imdbID, info=['filmography']) # beginning tags objWebPage.writelines('' + '\n\n') objWebPage.writelines('' + '\n\n') objWebPage.writelines('
' + '\n') objWebPage.writelines('\tObtained | Movie |
---|---|
') try: objWebPage.writelines('%s [role: %s] (%s)' % (movie['title'], movie.currentRole, movie['year'])) except: objWebPage.writelines('%s [role: %s] [%s]' % (movie['title'], movie.currentRole, 'In Production')) objWebPage.writelines(' |