def parse_chill(link): struct_link = get_link_from_menu_list_left(link, 'Структура института') cathedras = gather_name_link_of_cathedras_of_chill(struct_link) print(cathedras) result = {} for name, link in cathedras: stuff_link = None try: stuff_link = get_link_from_menu_list_left( link, 'Сотрудники и преподаватели') except: pass if not stuff_link: try: stuff_link = get_link_from_menu_list_left( link, 'Преподаватели и сотрудники') except: pass result[name] = stuff_link for name, stuff_link in result.items(): try: result[name] = gather_name_link_of_employees(stuff_link) except: pass return result
def parse_phys(link): struct_button_link = get_link_from_menu_list_left(link, 'Структура') cathedras, search_cath = gather_name_link_of_cathedras_of_phys( struct_button_link) result = {} search_cath['Кафедра теоретической физики'] = 'Коллектив кафедры' search_cath[ 'Кафедра астрономии и космической геодезии'] = 'Сотрудники кафедры' search_cath['Кафедра вычислительной физики'] = 'Коллектив кафедры' for name, link in cathedras: stuff_link = get_link_from_menu_list_left(link, search_cath[name]) result[name] = stuff_link for name, stuff_link in result.items(): if name == 'Кафедра радиоастрономии': result[name] = get_phys_teachers_rad_astr(stuff_link) else: try: result[name] = gather_name_link_of_employees(stuff_link) except AttributeError: result[name] = get_phys_teachers(stuff_link) return result
def parse_chem(link): struct_button_link = get_link_from_menu_list_left(link, 'Структура') cathedras = gather_name_link_of_cathedras_of_chem(struct_button_link) result = {} for name, link in cathedras: stuff_link = get_link_from_menu_list_left(link, 'Список сотрудников') result[name] = stuff_link for name, stuff_link in result.items(): result[name] = gather_name_link_of_employees(stuff_link) return result
def parse_engineer2(link): struct_button_link = get_link_from_menu_list_left_engineer( link, 'Структура') cathedras = gather_name_link_of_cathedras_of_engineer(struct_button_link) result = {} for name, link in cathedras: stuff_link = get_link_from_menu_list_left_engineer( link, 'Сотрудники кафедры') result[name] = stuff_link for name, stuff_link in result.items(): result[name] = gather_name_link_of_employees(stuff_link) return result
def parse_higher_school_buisness(link): employees_link = get_link_from_menu_list_left(link, 'Список сотрудников') return { 'Основная кафедра школы': gather_name_link_of_employees(employees_link) }