def get_sessions():
"""
Fetch and parse the schedule HTML from the NICAR webpage.
"""
html = fix_encoding(requests.get(SCHEDULE_URL).content)
dom = lxml.html.fromstring(html)
day_els = dom.cssselect("ul.listview.pane")
days_zipped = zip(day_els, DATES)
sessions_nested = [ parse_day(el, date) for el, date in days_zipped ]
sessions = itertools.chain.from_iterable(sessions_nested)
return list(sorted(sessions, key=itemgetter(
"date",
"time_start",
"time_end",
"title"
)))
评论列表
文章目录