2 wangweihua010 wangweihua010 于 2016.04.20 15:51 提问

这是JSON格式吗?怎么解析? 1C

用爬虫爬的谷歌翻译数据,用python的JSON模块解不出来

[[["关于","about",,,1],[,,"Guānyú","əˈbout"]],[["介词",["关于","对于","靠","靠近"],[["关于",["on","about","regarding","with respect to","with regard to","pertaining to"],,0.59712726],["对于",["for","regarding","about","with regard to","towards","toward"],,0.0044884402],["靠",["by","near","alongside","at","about"],,4.4508525e-07],["靠近",["near","anear","at","about","by"],,8.9022649e-08]],"about",5],["副词",["大约","左右","大概","周围","附近","模样","光景","溜","盖"],[["大约",["about","approximately","belike","say"],,0.083377652],["左右",["about","around","left and right","approximately"],,0.029268308],["大概",["probably","about","roughly","say","belike"],,0.0062315823],["周围",["around","round","about"],,0.00026125857],["附近",["nearby","about","hereabouts","hereabout"],,2.4683513e-05],["模样",["about"],,6.7480973e-06],["光景",["about","around"],,1.1544633e-06],["溜",["hereabouts","about","hereabout"],,1.7983069e-07],["盖",["about"],,8.9022649e-08]],"about",4]],"en",,,[["about",32000,[["关于",1000,true,false],["大约",1000,true,false],["对于",27,true,false],["对",0,true,false],["了解",0,true,false]],[[0,5]],"about",0,0]],1,,[["en"],,[1],["en"]],,,[["副词",[[["around","here and there","to and fro","back and forth","from place to place","hither and thither","in all directions"],"m_en_us1219359.007"],[["near","nearby","around","hereabouts","not far (off/away)","close by","in the vicinity","in the neighborhood"],"m_en_us1219359.008"],[["approximately","roughly","around","round about","in the region of","circa","of/on the order of","something like","or so","or thereabouts","there or thereabouts","more or less","give or take a few","not far off","in the ballpark of"],"m_en_us1219359.009"],[["around","in circulation","in existence","current","going on","prevailing","prevalent","happening","in the air","abroad"],"m_en_us1219359.005"],[["around"],""],[["approximately","some","or so","more or less","close to","just about","around","roughly"],""],[["well-nigh","nearly","almost","virtually","most","near","nigh"],""]],"about"],["介词",[[["regarding","concerning","with reference to","referring to","with regard to","with respect to","respecting","relating to","on","touching on","dealing with","relevant to","connected with","in connection with","on the subject of","in the matter of","apropos","re"],"m_en_us1219359.001"],[["around","round","throughout","over","through","on every side of"],"m_en_us1219359.004"]],"about"],["形容词",[[["astir"],""]],"about"]],[["副词",[["used to indicate movement in an area.","m_en_us1219359.007","men were floundering about"],["used to express location in a particular place.","m_en_us1219359.008","there was a lot of flu about"],["(used with a number or quantity) approximately.","m_en_us1219359.009","reduced by about 5 percent"]],"about"],["介词",[["on the subject of; concerning.","m_en_us1219359.001","I was thinking about you"],["used to indicate movement within a particular area.","m_en_us1219359.004","she looked about the room"],["used to express location in a particular place.","m_en_us1219359.005","rugs strewn about the hall"]],"about"]],[[["So impassioned am I about Croydon that I have put together a poetry book all \u003cb\u003eabout\u003c/b\u003e it.",,,,3,"m_en_us1219359.001"],["She looked inside to find the contents scattered \u003cb\u003eabout\u003c/b\u003e and then heard noises upstairs.",,,,3,"m_en_us1219359.008"],["she turned \u003cb\u003eabout\u003c/b\u003e and saw him",,,,3,"neid_56"],["A lot of us got out and waited for the emergency services, who arrived within \u003cb\u003eabout\u003c/b\u003e ten minutes.",,,,3,"m_en_us1219359.009"],["it's all \u003cb\u003eabout\u003c/b\u003e getting the figures right",,,,3,"neid_49"],["It quickly came in the form of a book on the subject, Girls Night In, or rather an article \u003cb\u003eabout\u003c/b\u003e the book.",,,,3,"m_en_us1219359.001"],["she wandered \u003cb\u003eabout\u003c/b\u003e tiredly",,,,3,"neid_52"],["do you have any weapons \u003cb\u003eabout\u003c/b\u003e your person?",,,,3,"neid_46"],["it's all \u003cb\u003eabout\u003c/b\u003e having fun",,,,3,"m_en_us1219359.001"],["However a spokesman for the firm declined to give any information \u003cb\u003eabout\u003c/b\u003e its intentions.",,,,3,"m_en_us1219359.001"],["he produced a knife from somewhere \u003cb\u003eabout\u003c/b\u003e his person",,,,3,"m_en_gb0001970.004"],["that sounds \u003cb\u003eabout\u003c/b\u003e right",,,,3,"neid_58"],["What does swimming \u003cb\u003eabout\u003c/b\u003e and spontaneously singing bits of the Batman theme song mean?",,,,3,"m_en_us1219359.007"],["rocks are strewn \u003cb\u003eabout\u003c/b\u003e at the bottom of the hill",,,,3,"neid_52"],["Why write a scientific book \u003cb\u003eabout\u003c/b\u003e a subject best left to poets and songwriters?",,,,3,"m_en_us1219359.001"],["rugs were strewn \u003cb\u003eabout\u003c/b\u003e the hall",,,,3,"m_en_gb0001970.004"],["he's \u003cb\u003eabout\u003c/b\u003e 35",,,,3,"m_en_us1219359.009"],["Couches, armchairs and tables were scattered \u003cb\u003eabout\u003c/b\u003e the place.",,,,3,"m_en_us1219359.008"],["finding my way \u003cb\u003eabout\u003c/b\u003e",,,,3,"m_en_gb0001970.006"],["the law is \u003cb\u003eabout\u003c/b\u003e ensuring people don't drink and drive",,,,3,"neid_49"],["Yet this is not all - the nature and placing of these units can say a lot \u003cb\u003eabout\u003c/b\u003e your intentions.",,,,3,"m_en_us1219359.001"],["it's \u003cb\u003eabout\u003c/b\u003e the worst thing you could do",,,,3,"neid_58"],["he was \u003cb\u003eabout\u003c/b\u003e early",,,,3,"neid_54"],["I won just \u003cb\u003eabout\u003c/b\u003e every competition",,,,3,"neid_57"],["finding my way \u003cb\u003eabout\u003c/b\u003e",,,,3,"m_en_us1219359.007"],["forget \u003cb\u003eabout\u003c/b\u003e him",,,,3,"neid_43"],["Even if you don't know \u003cb\u003eabout\u003c/b\u003e the subject matter, you can apply the generic skills to any business.",,,,3,"m_en_us1219359.001"],["be careful what you're \u003cb\u003eabout\u003c/b\u003e!",,,,3,"neid_50"],["he wore a sash \u003cb\u003eabout\u003c/b\u003e his waist",,,,3,"neid_47"],["I know nothing \u003cb\u003eabout\u003c/b\u003e it",,,,3,"neid_43"]]],[["About","what about","talk about","think about","bring about","about what","care about","about it","think about it","forget about it","talking about"]]]

10个回答

wangweihua010
wangweihua010   2016.04.20 15:54

python的json.loads()方法解,报错“ json.decoder.JSONDecodeError: Expecting value:...”
其中混杂着 \u003cb\u003e 和 \u003c/b\u003e 其实是标签.....怎么进行2次解码?

CSDNXIAOD
CSDNXIAOD   2016.04.20 16:02

Json格式解析
将文本内容解析成json格式
测试推送时格式问题解决 那个json解析
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!

xiaochaolovedan
xiaochaolovedan   2016.04.20 16:05

是json格式,可以用jsonView进行分解

xiaoyao880609
xiaoyao880609   2016.04.20 16:10

亲测是Json合适,json查看客户端推荐使用JSON Viewer 可以树状结构查看具体json数据。
官网: http://jsonviewer.codeplex.com/

wangweihua010
wangweihua010 请问用Python怎么解析呢?我反复试验好久一直报错
一年多之前 回复
zaizaisheng
zaizaisheng   2016.04.20 16:11

明明就不是json格式,楼上都不验证下吗,不信你自己校验下http://www.bejson.com/

w172087242
w172087242   Ds   Rxr 2016.04.20 16:23

你的这个数据结构是标准的多维数组结构,json是key-value格式的数据

w172087242
w172087242 最简单的json数组长这样[{},{},{}]
一年多之前 回复
w172087242
w172087242 回复DUDUAITUTU: 对象也不是json数组,json数组里面的应该是json对象,但是你里面的是数组,然后数组中最小数组单元就是字符串、数字等。所以这个跟json粘不上边。
一年多之前 回复
wangweihua010
wangweihua010 其实可以算是一种JSON吧,相当于没有KEY只有value,对象全是JSON数组。问题的关键是python解析不了。我用c#试试
一年多之前 回复
wangweihua010
wangweihua010 其实可以算是一种JSON吧,相当于没有KEY只有value,对象全是JSON数组。问题的关键是python解析不了。我用c#试试
一年多之前 回复
wangweihua010
wangweihua010 其实可以算是一种JSON吧,相当于没有KEY只有value,对象全是JSON数组。问题的关键是python解析不了。我用c#试试
一年多之前 回复
xiaochaolovedan
xiaochaolovedan   2016.04.20 17:16

jsonView,可以解析,不信试试,http://download.csdn.net/detail/xiaochaolovedan/9497092

huaitianqi2016
huaitianqi2016   2016.04.20 17:34

json格式为[{"key":"value"},{},{}]格式这种为list或者["name":[{"key":"value"},{},{}],"name":[{},{},{}]],格式为List>>你这个只是个数组无法解析

baidu_23086307
baidu_23086307   2016.04.22 12:18

用google提供的gson

hijack00
hijack00   Rxr 2016.08.23 12:43

python的json库功能还不是特别强,上次我的json文件里面含有注释(//或者/**/)也没有解析成功。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!