demjson-2.2.4
1. Recently, when parsing data, a Bug,
No nonsense, just look at the data
At that time, I saw json Format , I was very happy and thought it was direct json.loads() Soha will do , I didn't expect to report a mistake directly , Later, it was not standard json,key Without quotation marks at all ,
After some searching, we finally found a solution , The operation is as follows
pip3 install demjson
Then we can deal with it like this
import demjson
json_str = '{id: 1,lng: 104.08674,lat: 30.656809 ,title: " sichuan ( Taiguli store )",content: [" Address : Xia, Jinjiang District, Chengdu City, Sichuan Province ", " Telephone :12345678 "]}'
result = demjson.decode(json_str)
print(result)
notes , If the installation times the following error
Solution
pip install setuptools==57.5.0