I am trying to load a json-like string using the json library:
data = json.loads(raw_json.replace(" ","").replace("\n",""))
However I get the following error:
JSONDecodeError: Expecting ',' delimiter
I looked at this question but it doesn't seem to help... also I have no idea howto convert my string to a raw string using its variable name... The only problem that I can see in my raw_json variable is that it has a lot of spaces and newlines. My raw_json variable looks like this:
{
"search": {
"levier": "Recherchedepuislaliste",
"nbresults": "137 314",
"nbpage": "1",
"typedetransaction": ["vente", "viager"],
"nbpieces": [""],
"typedebien": ["Appartement", "Maison/Villa"],
"pays": "FR",
"nbchambres": [""],
"budget": {"min": "", "max": ""},
"surface": {"min": "", "max": ""},
"surface_terrain": {"min": "", "max": ""},
"type": [{"name": "Nouvellerecherche", "value": true},
{"name": "Dernièrerecherche", "value": false},
{"name": "Rechercheenregistrée", "value": false}],
"etage": {"min": "", "max": ""},
"tri": {"criteria": "Sélection",
"direction": ""},
"chauffage": [{"name": "individuel", "value": false},
{"name": "central", "value": false},
{"name": "electrique", "value": false},
{"name": "gaz", "value": false}]
}