From an API I am getting following JSON String which I want to convert into python dict.
{
"title":"size_fit_desc",
"description":"\u003Cp\u003ERegular Fit\u003Cbr \u002F\u003EThe model (height 5'8\", chest 33\" and waist 28\") is wearing a size M.\u003C\u002Fp\u003E"
}
If I try to load it using json.loads()
It gives me an error
ValueError: Expecting property name: line 3 column 97 (char 136)
However If I try to use this string as raw string then it works.
s = r"""{
"title":"size_fit_desc",
description":"\u003Cp\u003ERegular Fit\u003Cbr \u002F\u003EThe model (height 5'8\", chest 33\" and waist 28\") is wearing a size M.\u003C\u002Fp\u003E"
}"""
I think there an issue with an escaping at (height 5'8\", chest 33\"
.
How can I assign this json string from API to python string object and convert it into dict using json.loads(s)
?
json.loads(json.dumps(s)) does not work.