コード例 #1
0
def html():
    """Encoded HTML data from URL or cache (if it exists).

    Returns:
        str: Raw bytes returned from URL/file
    """
    return httpget(url, cachepath)
コード例 #2
0
def html():
    """Wiktionary HTML.

    Returns:
        str: HTML at ``url``.
    """
    return httpget(url, path)
コード例 #3
0
def html():
    """Wiktionary HTML.

    Returns:
        str: HTML at ``url``.
    """
    return httpget(url, path)
コード例 #4
0
def html():
    """Encoded HTML data from URL or cache (if it exists).

    Returns:
        str: Raw bytes returned from URL/file
    """
    return httpget(url, cachepath)
コード例 #5
0
def main():
    html = httpget(url, cachepath)
    soup = BS(html, 'html.parser')
    for row in soup.find_all('tr'):
        cells = row.find_all('td')
        if len(cells) != 10:
            continue
        cells = cells[3:5]
        # print(cells)
        name, abbr = [e.get_text().strip() for e in cells]
        if len(abbr) != 2:
            continue

        name = name.split(u',', 1)[0].strip()

        print_lang(Lang(abbr, name))
コード例 #6
0
def main():
    html = httpget(url, cachepath)
    soup = BS(html, 'html.parser')
    for row in soup.find_all('tr'):
        cells = row.find_all('td')
        if len(cells) != 10:
            continue
        cells = cells[3:5]
        # print(cells)
        name, abbr = [e.get_text().strip() for e in cells]
        if len(abbr) != 2:
            continue

        name = name.split(u',', 1)[0].strip()

        print_lang(Lang(abbr, name))
コード例 #7
0
def html():
    return httpget(url, cachepath).decode('ISO-8859-1')