def get_channel_schedule(self, url):
"""Get movie schedule from CJ E&M channels."""
schedule = self.get_original_data(url).find('div', class_='scheduler')
date_text = schedule.find('em').text[:-4].strip()
date_split = date_text.split(".")
# If date is different from the day of argument, return None.
if "".join(date_split) != url[-8:]:
return None
schedule_date = timezone.datetime(int(date_split[0]), int(date_split[1]), int(date_split[2]))
schedule_table = schedule.find('tbody').find_all('tr')
if len(schedule_table) == 0:
# If no schedule exists
return None
return self.parse_daily_schedule(schedule_table, schedule_date)
movie_schedule_parser.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录