def getSpecificTheaterPlays(leporello_info, file_name, play_type, url): theater_plays = [] leporello_file_name_on_disk = Lepistant.createFilePath( Lepistant.REL_PATH_DOWNLOADS_FOLDER, file_name, 'html') soup = Lepistant.getSoup(url, leporello_file_name_on_disk) theater_play_items = Lepistant.getTagsByClass(soup, 'div', leporello_info[CSS_CLASS_PLAY_ITEM]) # for play_item in theater_play_items: # title = getTitleFromPlayItem(play_item) # theater_plays.append(title) for play_item in theater_play_items: logger.info('>>>>>>>>>>>>>>>>>>>>>>>> Fetching new play <<<<<<<<<<<<<<<<<<<<<<<<<') play = Play(play_item) play.setType(play_type) play.link = Lepistant.getURLFromTagContent(play_item) formatted_title = Lepistant.removeNonAlphanumericCharacters(play.title) play.file_path_on_disk = Lepistant.REL_PATH_PLAYS_FOLDER + formatted_title + '/' play.file_name_on_disk = Lepistant.createFilePath( play.file_path_on_disk, play.title, 'html') soup = Lepistant.getSoup(play.link, play.file_name_on_disk) play.setPlayDetails(soup) setDefaultTimeForPerformancesInPlay(play) logger.info('') theater_plays.append(play) return theater_plays
def getSpecificTheaterPlays(leporello_info, file_name, play_type, url): theater_plays = [] leporello_file_name_on_disk = Lepistant.createFilePath( Lepistant.REL_PATH_DOWNLOADS_FOLDER, file_name, 'html') soup = Lepistant.getSoup(url, leporello_file_name_on_disk) theater_play_items = Lepistant.getTagsByClass( soup, 'div', leporello_info[CSS_CLASS_PLAY_ITEM]) # for play_item in theater_play_items: # title = getTitleFromPlayItem(play_item) # theater_plays.append(title) for play_item in theater_play_items: logger.info( '>>>>>>>>>>>>>>>>>>>>>>>> Fetching new play <<<<<<<<<<<<<<<<<<<<<<<<<' ) play = Play(play_item) play.setType(play_type) play.link = Lepistant.getURLFromTagContent(play_item) formatted_title = Lepistant.removeNonAlphanumericCharacters( play.title) play.file_path_on_disk = Lepistant.REL_PATH_PLAYS_FOLDER + formatted_title + '/' play.file_name_on_disk = Lepistant.createFilePath( play.file_path_on_disk, play.title, 'html') soup = Lepistant.getSoup(play.link, play.file_name_on_disk) play.setPlayDetails(soup) setDefaultTimeForPerformancesInPlay(play) logger.info('') theater_plays.append(play) return theater_plays