# http://i...content-available-to-author-only...u.ua/name/%s/ % rand(1,300)
from urllib.request import urlopen
from random import randint
from re import findall, search

SUR_MAX = 300


def get(url):
    print(url)
    return urlopen(url).read()


def get_name(html):
    pattern = r"<h1>(.*)</h1>"
    import codecs

    res = findall(pattern, str(html))[0]
    sym = res.split('\\')
    print(sym)
    print(list(map(lambda x: codecs.decode(x, 'utf16'), sym)))
    # bytearray([ord(x) for x in res.split('\\')])
    res = codecs.decode(bytearray(res, encoding="utf-8"), encoding="utf-8")

    return res

surname_seed = randint(0, SUR_MAX)
html = get("http://i...content-available-to-author-only...u.ua/name/%s/" % surname_seed)

print(get_name(html))


import codecs
res = "\xcd\xe8\xf1\xee\xed"
res = codecs.decode(bytearray(res, encoding="cp1252"), encoding="cp1251")
print(res)