这是我打印日志时的JSON结果。我无法从这个结果中获得数据。请建议如何从这个结果中获得数据。错误显示of类型org.json.jsonArray不能转换为JSONObject,我知道已经有很多文章与此相关,但我不明白如何获取数据。
09-12 05:12:57.606: W/System.err(3385): org.json.JSONException: Value
[
{
"client": [
{
"office_name": "",
"is_verified": "1",
"forum_email_notification": "1",
"city": "",
"first_name": "Pratik",
"balance": "0",
"option_domain_name": "Vision",
"initials": "Mr",
"client_type": "0",
"group_credit": "0.00",
"gender": "0",
"is_approved": "1",
"domain_name": "Vision",
"client_id": "2",
"otherim": "",
"credit": "0.00",
"is_spam": "0",
"office_phone": "",
"parent_id": "0",
"domain_url": "http://example.com/vision4/sandip/v5/",
"fax": "",
"forum_signature_content": "",
"group_id": "1",
"optionB_domain_id": "1",
"country": "",
"contact_number": "",
"user_name": "test",
"email": "pratik@test.com",
"job_title": "",
"last_name": "T",
"parent_name": "",
"temporary_address": "",
"facebook_id": "",
"language": "1",
"office_contact_num": "",
"salt": "e2e838b89b16f488a901b3b364ad839e",
"zip_code": "",
"office_website": "",
"department": "",
"state": "",
"office_fax": "",
"login_as": "0",
"currency": "USD",
"permanent_address": "",
"department_access": "0",
"is_manager": "0",
"birthdate": "",
"registration_date": "1504254310",
"parent_email": "",
"password_auth": "0",
"group_name": "Default",
"netmeetingid": "",
"website": "",
"domain_id": "1",
"is_banned": "0",
"twitter_id": "",
"mobile_number": "",
"office_address": "",
"authentication": "383Y4A==",
"harvest_id": "0",
"image_path": "",
"office_email": ""
}
],
"unsolve": 3,
"solve": 0
}
]
of type org.json.JSONArray cannot be converted to JSONObject
这是因为您的结果是一个JSONObject数组,而不是JSONObject本身
问题内容: 我正在解决有关作为服务器响应的JSONObject的问题。 正如您在响应中看到的那样,我正在解析JSONObject并创建syncresponse,synckey作为 JSON对象 createdtrs,modtrs,deletedtrs作为 JSONArray 。我想从Deletedtrs访问JSONObject,以便可以将它们分开并使用这些值。即我想提取公司编号,用户名,日期等。
我正在努力在Python中做一个实时货币转换器。我已经成功地将URL所需的所有数据提取到Python中。但是,我现在尝试在URL中调用特定字符串。这是我当前的代码: 如您所见,我已经打印了它获取的所有数据,但它现在正在从中打印特定的字符串。 我的问题是,如何从URL解析特定字符串?我听说过json.load,这是我应该使用的东西吗?
我有三张桌子:
我有一个如下所示的数据帧: 我需要提取lat=30.75和lon 76.25的行,对于我使用的行: 但这表明了这个错误:
我有点麻烦。 我需要创建一个网站,使用以下API显示三个随机的Chuck Norris笑话:http://www.icndb.com/api/。我必须使用以下URL获取笑话:http://api.icndb.com/jokes/random/3。 我的HTML如下: 我的Javascript如下: HTML显示正确,但在控制台中,即使我调用一个笑话,所有三个笑话也会出现。请看下面的截图: 事先谢谢