示例#1
0
async def openedu_ru_parser(site, session):
    url = site_url(site, "/course/")
    text = await session.text_from_url(url)
    site.add_to_fingerprint(text)
    count = element_by_css(text, "span#courses-found")
    assert " кур" in count.text
    return int(count.text.split()[0])
示例#2
0
async def entuze_parser(site, session):
    url = site_url(site, "/course_packages/")
    text = await session.text_from_url(url)
    site.add_to_fingerprint(text)
    elt = element_by_css(text, "div#discovery-message")
    result = parse_text("Viewing {:d} courses", elt.text)
    return result[0]
示例#3
0
async def edcast_org_parser(site, session):
    url = site_url(site, "/search")
    text = await session.text_from_url(url)
    site.add_to_fingerprint(text)
    h4 = element_by_css(text, ".search-navigation-row h4")
    result = parse_text("All Courses ({:d} matches)", h4.text)
    return result[0]
示例#4
0
async def campus_il_parser(site, session):
    url = site_url(site, "/course")
    text = await session.text_from_url(url)
    site.add_to_fingerprint(text)
    elt = element_by_css(text, "span#add-sum-course")
    count = int(elt.text)
    return count
示例#5
0
async def learning_hku_parser(site, session):
    url = site_url(site, "/catalog/all-courses/")
    text = await session.text_from_url(url)
    site.add_to_fingerprint(text)
    elt = element_by_css(text, "li#course-all span")
    count = int(elt.text)
    return count
示例#6
0
async def enlightme_parser(site, session):
    url = site_url(site, "/courses/")
    text = await session.text_from_url(url)
    site.add_to_fingerprint(text)
    elt = element_by_css(text, ".course-index span")
    result = parse_text("Showing 1-10 of {:d} results", elt.text)
    return result[0]