Print(Json_text)
'{\n \n acorn: "",\n acorn_type: "",\n area_name: "Glasgow",\n beds_max: 2,\n beds_min: 2,\n }
I tried to solve it doing:
json_text = re.sub(r'\n', '',json_text)
json_text = re.sub(r' ', '',json_text)
then the results:
print(json_text)
'{acorn:"",acorn_type:"",area_name:"Glasgow",beds_max:2,beds_min:2,branch_id:"32896"}
then I tried to convert to Json Format:
json_text= json.dumps(json_text)
json_text = json.loads(json_text)
But the final value is an string.
json_text['area_name']
TypeError: string indices must be integers
i think is because the Key values don't have quotations ("")