def parse_ok_ru(account):
    html = None
    tries = 0
    while (html is None):
        try:
            html = urllib.request.urlopen(('https://ok.ru/' + account)).read().decode()
        except HTTPError:
            if (tries > 3):
                return None
            tries += 1
            sleep((2 ** tries))
    match = re.search('<a data-module="AuthLoginPopup" href="/profile/(\\d+)"', html)
    if (match is None):
        return None
    return match.group(1)
def parse_ok_ru(account):
    html = None
    tries = 0
    while (html is None):
        try:
            html = urllib.request.urlopen(('https://ok.ru/' + account)).read().decode()
        except HTTPError:
            if (tries > 3):
                return None
            tries += 1
            sleep((2 ** tries))
    match = re.search('<a data-module="AuthLoginPopup" href="/profile/(\\d+)"', html)
    if (match is None):
        return None
    return match.group(1)