[Python] JavaScript Object to JSON using python

Discussão em 'Python' iniciado por Stack, Maio 19, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to retrieve what initially looked like a normal JSON from a website. But it is a JavaScript object which is not a valid JSON. Is there a way to convert this string to JSON using python?

    Example would be:

    {
    firstName:"John",
    lastName:"Doe",
    age:50,
    eyeColor:"blue",
    dimensions:[
    {
    height: "2",
    width: "1"
    }
    ]
    }

    Continue reading...

Compartilhe esta Página