Ejemplo n.º 1
0
def parse_physics(url):
    struct_link = get_link_from_button(url, 'Структура')
    cathedras = get_cathedras(struct_link)

    res = {}
    for name, url in cathedras:
        url1 = get_link_from_button(url, 'Сотрудники')
        url2 = get_link_from_button(url, 'Сотрудники кафедры')
        url3 = get_link_from_button(url, 'Коллектив кафедры')
        if url1:
            res[name] = url1
        elif url2:
            res[name] = url2
        elif url3:
            res[name] = url3

    for name, stuff_url in res.items():
        if name == 'Кафедра радиоастрономии':
            res[name] = len(get_stuff2(stuff_url))
        else:
            try:
                res[name] = len(get_stuff(stuff_url))
            except:
                res[name] = len(get_stuff2(stuff_url))
    return res


# print(parse_physics(url_phys))
Ejemplo n.º 2
0
def parse_chemistry(url):
    info_button_url = get_link_from_button(url, 'Структура')
    cathedras = get_cathedras(info_button_url)

    res = {}
    for name, url in cathedras:
        stuff_url = get_link_from_button(url, 'Список сотрудников')
        stuff = get_stuff(stuff_url)
        res[name] = len(stuff)

    return res
Ejemplo n.º 3
0
def parse_philology(url):
    struct_button_url = get_link_from_button(url,'Структура')
    cathedras = list()
    schools = get_schools(struct_button_url)
    res = {}
    for name,url in schools:
        tmp = get_cathedras(url)
        cathedras+=tmp

    for name, url in cathedras:
        stuff_button_url = get_link_from_button(url,'Сотрудники')
        res[name] = len(get_stuff(stuff_button_url))
    return res
Ejemplo n.º 4
0
def parse_law(url):
    cathedras = get_cathedras(url)

    res = {}
    for name, url_cath in cathedras:
        url1 = get_link_from_button(url_cath, 'Сотрудники')
        url2 = get_link_from_button(url_cath, 'Сотрудники кафедры')
        if url1:
            stuff_url = url1
        elif url2:
            stuff_url = url2
        stuff = get_stuff(stuff_url)
        res[name] = len(stuff)
    return res
Ejemplo n.º 5
0
def parse_mehmat(url):
    struct_link = get_link_from_button(url, 'Структура')
    cathedras = get_name_links_cathedras(struct_link)

    res = {}
    for name, url in cathedras:
        url1 = get_link_from_button(url, 'Сотрудники')
        url2 = get_link_from_button(url, 'Состав кафедры')
        if url1:
            res[name] = url1
        elif url2:
            res[name] = url2

    for name, stuff_url in res.items():
        res[name] = len(get_stuff(stuff_url))
    return res
Ejemplo n.º 6
0
def parse_engineer(url):
    struct_button_url = get_link_from_button(url, 'Структура')
    cathedras = get_cathedras(struct_button_url)

    res = {}

    for name, url in cathedras:
        url1 = get_link_from_button(url, 'Состав кафедры')
        url2 = get_link_from_button(url, 'Сотрудники кафедры')
        if url1:
            stuff_url = url1
        elif url2:
            stuff_url = url2
        res[name] = len(get_stuff(stuff_url))

    return res
Ejemplo n.º 7
0
def parse_psychology(url):
    struct_btn_link = get_link_from_button(url, 'Структура')
    cathedras_link = get_link_from_button(struct_btn_link, 'Кафедры')

    cathedras = get_cathedras(cathedras_link)
    res = {}
    for name, url_cath in cathedras:
        url1 = get_link_from_button(url_cath, 'Сотрудники')
        url2 = get_link_from_button(url_cath, 'Сотрудники кафедры')
        if url1:
            stuff_url = url1
        elif url2:
            stuff_url = url2
        stuff = get_stuff(stuff_url)
        res[name] = len(stuff)
    return res
Ejemplo n.º 8
0
def parse_ecology(url):
    info_button_url = get_link_from_button(url, 'Структура')
    cathedras = get_name_link_of_cathedras_ecology(info_button_url)

    res = {}

    for name, url in cathedras:
        stuff_url = get_link_from_button(url, 'Состав')
        res[name] = stuff_url

    for name, url in res.items():
        res[name] = len(get_name_link_of_teachers(url))

    return res


# print(parse_ecology('https://kpfu.ru/ecology'))
Ejemplo n.º 9
0
def parse_buisness(url):
    stuff_url = get_link_from_button(url, 'Список сотрудников')
    return {'Высшая школа бизнеса': len(get_stuff(stuff_url))}


# print(parse_buisness(url_buisness))