response = requests.get(CHARACTER_URL + chart, headers=HEADERS)
json_data = response.json() # Здесь ты уже получаешь json
ui.label1.setText('User ID : {}'.format(json_data['info']['id']))
ui.label2.setText('User Type : {}'.format(json_data['info']['type']))
ui.label3.setText('User Name : {}'.format(json_data['info']['name']))
ui.label4.setText('User SecStatus : {}'.format(json_data['info']['secStatus']))
# Для вывода строк старайся не использовать сложение строк "+"
while True:
search_name = input('Название телефона: ') # отдаем название
url = 'http://www.gadget.kg/catalog/search?q='
full_url = (url + search_name.replace(' ', '+')) # в search_name меняю пробелы на +
HOST = 'http://www.gadget.kg'
html = get_html(full_url)
get_data(html)
for search_name in items_name_list:
url = 'http://www.gadget.kg/catalog/search'
payload = {'q': search_name }
response = requests.get(url, params=payload)
get_data(response.text)
profile.add_extension(extension="some_extension_name.xpi")
for point in value2:
for p in result:
point.update({'№п/п четная нед.': p['index']})
# By using the 'with' statement we are sure the session is closed, thus we
# avoid leaving sockets open which can trigger a ResourceWarning in some
# cases, and look like a memory leak in others.
with sessions.Session() as session:
return session.request(method=method, url=url, **kwargs)