import urllib.request


def get_htmls(urls, timeout):
    """get htmls from urls array.
    args:
        urls([str]): urls string array.
        timeout(int): seconds
    return:
        [url, html]
        url: str
        html: str
    """
    ret = []
    for url in urls:
        try:
            with urllib.request.urlopen(url, timeout=timeout) as conn:
                html = conn.read().decode("utf-8", errors="ignore")
        except:
            pass
        else:
            ret.append([url, html])
    return ret