I grabbed a piece of json from the web page. When processing it in python, I encountered the problem of double quotes and single quotes. Is there anyone who has dealt with it? Can you help me? ValueError: Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
Official regulations require the use of double quotes to represent characters, so I have to replace all single quotes with double quotes first?
Is there a better way?
Json.dumps() first and then loads() will not work either
Although loads() does not report an error, the processing result cannot be used as a dictionary and is in string formTypeError: string indices must be integers
There are some third-party Json libraries that can solve some compatibility issues, such as the problem of single quotes. It seems that Simplejson can do it.
Problem solved