def html(): """Encoded HTML data from URL or cache (if it exists). Returns: str: Raw bytes returned from URL/file """ return httpget(url, cachepath)
def html(): """Wiktionary HTML. Returns: str: HTML at ``url``. """ return httpget(url, path)
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))
def html(): return httpget(url, cachepath).decode('ISO-8859-1')