from urllib import request
from urllib.parse import quote
def poiskpers(nick):
geourl = "http://ru.wikipedia.org/wiki/".format(quote(nick))
respornse = request.urlopen(geourl)
content = respornse.read()
return content
print(poiskpers("василий"))
import urllib.request
import json
def poiskpers(nick):
geourl = "http://kakoito.sait/"+nick
geourl = geourl.encode('punycode')
respornse = urllib.request.urlopen(geourl.decode('ASCII'))
content = respornse.read()
data = json.loads(content.decode("utf8"))
print(data)
print(poiskpers("василий"))
class Part(object):
def __init__(self):
self.part = {'id': '01'}
self.char = {'char_id': 'CHAR'}