python - How to use simplejson to decode following data? -
I get some data from a URL, and search online for detecting data in Jason Data Format, but When I tried to use Simplejson.loads (data), this would increase the exception.
The first deal with Jason Data, any suggestions for decoding the data? Thanks
================ Result = Simple. Load (data, encoding = "UTF -8") file "F: \ My Documents \ My Dropbox \ Stokdetadaunloder \ Srljasn__init __. PE", line 401, the load returns class (encoding = encoding ** KW). Decoded (files), file "F: \ My Documents \ My Dropbox \ Stokdata Daunloder \ Srljasn \ decoder" line 402, decoded in Oz, end = Swkro_dekod (S, Aidiaks = _w (S, 0) Kend ()) file "F: \ My documents \ My Dropbox \ Stokdataunloder \ Srljasn \ decoder", line 420, can not be decoded a JSON object JSONDecodeError ( "in Raw_decode is" S, Aidiadi) simplejson.decoder.JSONDecodeError: a JSON The object can not be decoded: line 1 co 0 (four 0)
=== ==================================
data = "{identifier: 'id', label: 'Wednesday 4th August 2010 05:05 PM', item: [[id: 0, n 'second moon', nc: '528 ', R:' No ', I:' No ', L: 0.335, C: 0.015, VL: 51.000, BV: 20.000, B: 0.330, S: 0.345, SV: 20.000 O: 0.335 H: 0.335, L: 0.335, V: 17085.000, SC: '4', PV: 0.320, P 4.6875, P _ 'X', V _ ''}, {id: 1, N: "8Telecom ', NC:' E25 ', R:' None ', I:' None ', M:' - ', LT: 0.190, C: 0.000, VL: 965,000, BV: 1305.000, B: 0.185, S: 0.190, SV: 641.000 O: 0.185, HK: 0.190, L: 0.185, V: 179525.000, SC: '2', PV: 0.190, P: 0.0, P _: 'X', V_: ''} {id: 2, n: 'one-sound', nc: 'a53' , R: 'None', I: 'None', M: '-', LT: 0.090, C: 0.005, VL: 1278.000, BV: 17.000, B: 0.090, S: 0.095, SV: 346,000 O: 0.090 H: 0.090, L: 0.090, V: 115,020.000, SC: A, PV: 0.085, P: 5.882352734375, P _ 'X', V _ ''}, {id: 3, N ' AA Group, NC: "5GZ 'R' no 'I' no 'M' T ', LT: 0.000, C: 0.000, VL: 0.000, BV: 100,000, B: 0.050, S: 0.060, SV: 50.000, O: 0.000, H: 0.000, L: 0.000, V: 0.000, SC: '2', PV: 0.050, P: 0.0, P _: 'X', V _: ''}]} "
> Simplejson , but the site that tells you that the data is not using the JSON format properly To see if JSON is: In the Object diagram, {
(unless the object is not empty, in that case a }, to see Simple syntax uses diagram.
is as follows), JSON always has a string - and as you see it in the that diagram, its Meaning that starts with a double quote, hence the beginning of the string:
{identifier:
That is wrong JSON - word no double quotes around the identifier
.
To solve this problem is not as easy as it is to recognize, but I want you to at least assure your code. Breathing It seems that broken websites, such great traditions in the old HTML days, live with us no matter how modern technology they break ...: - (
Comments
Post a Comment