python-这是JSON格式吗?怎么解析?

问题描述

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

用爬虫爬的谷歌翻译数据,用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 u003cbu003eaboutu003c/bu003e it.",,,,3,"m_en_us1219359.001"],["She looked inside to find the contents scattered u003cbu003eaboutu003c/bu003e and then heard noises upstairs.",,,,3,"m_en_us1219359.008"],["she turned u003cbu003eaboutu003c/bu003e and saw him",,,,3,"neid_56"],["A lot of us got out and waited for the emergency services, who arrived within u003cbu003eaboutu003c/bu003e ten minutes.",,,,3,"m_en_us1219359.009"],["it's all u003cbu003eaboutu003c/bu003e 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 u003cbu003eaboutu003c/bu003e the book.",,,,3,"m_en_us1219359.001"],["she wandered u003cbu003eaboutu003c/bu003e tiredly",,,,3,"neid_52"],["do you have any weapons u003cbu003eaboutu003c/bu003e your person?",,,,3,"neid_46"],["it's all u003cbu003eaboutu003c/bu003e having fun",,,,3,"m_en_us1219359.001"],["However a spokesman for the firm declined to give any information u003cbu003eaboutu003c/bu003e its intentions.",,,,3,"m_en_us1219359.001"],["he produced a knife from somewhere u003cbu003eaboutu003c/bu003e his person",,,,3,"m_en_gb0001970.004"],["that sounds u003cbu003eaboutu003c/bu003e right",,,,3,"neid_58"],["What does swimming u003cbu003eaboutu003c/bu003e and spontaneously singing bits of the Batman theme song mean?",,,,3,"m_en_us1219359.007"],["rocks are strewn u003cbu003eaboutu003c/bu003e at the bottom of the hill",,,,3,"neid_52"],["Why write a scientific book u003cbu003eaboutu003c/bu003e a subject best left to poets and songwriters?",,,,3,"m_en_us1219359.001"],["rugs were strewn u003cbu003eaboutu003c/bu003e the hall",,,,3,"m_en_gb0001970.004"],["he's u003cbu003eaboutu003c/bu003e 35",,,,3,"m_en_us1219359.009"],["Couches, armchairs and tables were scattered u003cbu003eaboutu003c/bu003e the place.",,,,3,"m_en_us1219359.008"],["finding my way u003cbu003eaboutu003c/bu003e",,,,3,"m_en_gb0001970.006"],["the law is u003cbu003eaboutu003c/bu003e 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 u003cbu003eaboutu003c/bu003e your intentions.",,,,3,"m_en_us1219359.001"],["it's u003cbu003eaboutu003c/bu003e the worst thing you could do",,,,3,"neid_58"],["he was u003cbu003eaboutu003c/bu003e early",,,,3,"neid_54"],["I won just u003cbu003eaboutu003c/bu003e every competition",,,,3,"neid_57"],["finding my way u003cbu003eaboutu003c/bu003e",,,,3,"m_en_us1219359.007"],["forget u003cbu003eaboutu003c/bu003e him",,,,3,"neid_43"],["Even if you don't know u003cbu003eaboutu003c/bu003e the subject matter, you can apply the generic skills to any business.",,,,3,"m_en_us1219359.001"],["be careful what you're u003cbu003eaboutu003c/bu003e!",,,,3,"neid_50"],["he wore a sash u003cbu003eaboutu003c/bu003e his waist",,,,3,"neid_47"],["I know nothing u003cbu003eaboutu003c/bu003e 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"]]]

解决方案

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

解决方案二:

Json格式解析
将文本内容解析成json格式
测试推送时格式问题解决 那个json解析

解决方案三:

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

解决方案四:

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

解决方案五:

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

解决方案六:

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

解决方案七:

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

解决方案八:

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

解决方案九:

用google提供的gson

时间: 2024-04-25 21:17:43

python-这是JSON格式吗?怎么解析?的相关文章

json解析-请问这样的json格式该怎样解析?具体的实体类该怎么定义?每个item的属性个数不一样,这样该怎么定义属性?

问题描述 请问这样的json格式该怎样解析?具体的实体类该怎么定义?每个item的属性个数不一样,这样该怎么定义属性? {result"":""200""//String类型成功时返回200newsList"": [ {type"":1//type为1时是新闻,2是广告,3.图酷title"":""""//新闻标题img"":&

python 把数据 json格式输出的实例代码_python

有个要求需要在python的标准输出时候显示json格式数据,如果缩进显示查看数据效果会很好,这里使用json的包会有很多操作 import json date = {u'versions': [{u'status': u'CURRENT', u'id': u'v2.3', u'links': [{u'href': u'http://controller:9292/v2/', u'rel': u'self'}]}, {u'status': u'SUPPORTED', u'id': u'v2.2'

php 无限级数据JSON格式及JS解析_php实例

Flash需要JSON格式的数据,于是,就有了如下代码:(PHP实现,C#类似,JSON库自己去下吧~~) 复制代码 代码如下: //--查询用户下线信息,返回JSON,用于flash if(!empty($_GET['action'])&&!empty($_GET['invite'])){ //固定参数请求才会返回信息 if($_GET['action']=='getinfo'&&$_GET['invite']==1){ //数据实体,一个实体类 class UcInvi

json格式值班表解析

这几天因为一些特殊原因,网站值班表不能用,一旦出现问题,找相应系统的值班人员,就比较困难了,但通过一些渠道,可以有一个文本文件,其中包含了这几天的值班信息,为了更明白的说明问题,我们假设有A系统和B系统,两个值班,其中A系统值班人员为,每人值一天, B系统值班人员为,每人值一天, json格式的文件,准确的说,应该是json数组,如下所示, {    "dlist": [        {            "dId": "1743664",

python将json格式的数据转换成文本格式的数据或sql文件

python如何将json格式的数据快速的转化成指定格式的数据呢?或者转换成sql文件? 下面的例子是将json格式的数据准换成以#_#分割的文本数据,也可用于生成sql文件. [root@bogon tutorial]# vi json2txt.py #-*- coding: UTF-8 -*- import json data = [] with open('./tencent_test.json') as f: for line in f: data.append(json.loads(l

PHP JSON格式数据交互实例详解

此前我写了不少在PHP网站开发中应用XML进行数据交互的实例,这两天通过PHP解析JSON并进行交互的实例学习和了解了JSON在PHP中的应用,感觉非常方便,在PHP中解析JSON主要用到json_encode和json_decode两个PHP JSON函数,比PHP解析XML方便很多,下面详细介绍下PHP JSON的使用. JSON基础介绍 JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式. JSON主要有两种结构: "名称/值"对的集合,

PHP JSON格式数据交互实例代码详解_php技巧

在PHP中解析JSON主要用到json_encode和json_decode两个PHP JSON函数,比PHP解析XML方便很多,下面详细介绍下PHP JSON的使用.JSON基础介绍 JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式. JSON主要有两种结构: "名称/值"对的集合,在PHP中可以理解为关联数组 (associative array). 值的有序列表(An ordered list of values).在PHP中可以理解为

Jquery解析Json格式数据过程代码

 今天稍微学习了一下Json,JSON (JavaScript Object Notation) 是一种轻量级的数据交换格式. 易于人阅读和编写.同时也易于机器解析和生成. JSON采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++, C#, Java, JavaScript, Perl, Python等). 这些特性使JSON成为理想的数据交换语言. JSON建构于两种结构: "名称/值"对的集合(A collection of name/value

Jquery解析Json格式数据过程代码_jquery

今天稍微学习了一下Json,JSON (JavaScript Object Notation) 是一种轻量级的数据交换格式. 易于人阅读和编写.同时也易于机器解析和生成. JSON采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++, C#, Java, JavaScript, Perl, Python等). 这些特性使JSON成为理想的数据交换语言. JSON建构于两种结构: "名称/值"对的集合(A collection of name/value p