При парсинге сайта hh.ru, мне python выдает такой ответ:
TypeError: list indices must be integers or slices, not str
Мой скрипт:
for i in s_json['items']:
s1= requests.get(i['url'])
s1_json = json.loads(s1.text)
print(s1_json['name'], s1_json['description'], s1_json['professional_roles']['name'], s1_json['working_time_intervals']['name'], s1_json[int('salary')]['from'], s1_json['area']['name'])
cursor.execute("INSERT INTO vacansys_hh.ru (name, description, position, hours_work, salary, area) VALUES(%s,%s,%s,%s,%s,%s,%s)" % (i['name'], s1_json['description'], s1_json['professional_roles']['name']), s1_json['working_time_intervals']['name'], i['salary']['from'], i['area']['name'])