伙计们,这正是服务器发送的内容:
{
"type": 1,
"data": [
{
"notificationId": "3006649",
"accountId": "8-102ba1ae858f3e89",
"pathIds": "969E844AE95",
"pathTypes": "[\"6\"]",
"pathNames": "[\"Direct Calendar\"]",
"conversationUid": "94hirwrTx",
"appInstanceId": "6",
"pathCreatedBy": "[\"e050-910a19a97fe6\"]",
"actionBy": "f3dc-e78f-e050-910a19a97fe6",
"action": "COMMENTED",
"relationship": "DIRECTED",
"forUser": "8cc9-e050-910a19a96718",
"timestamp": "1433168593342",
"description": "<span style='color:#111111; '><a href=\"co:\/v1\/w_88bac084a1ae858f3e89\/feed?q=from%3A%22r%40wakanoo.com%22#title=A%20Qa%20Qu&filter_value=-950afb167d96\" class=\"text-editor-at-mention 03b4-e040-950afb167\">@A B<\/a> Please verify.<\/span>",
"data": null,
"isArchived": 0,
"isRead": 0,
"actionByUsers": {
"e050-910a19a97fe6": {
"profile_image_type": "1",
"profile_image_version": "1",
"name": "Yabba dabba"
}
},
"resourceLink": null,
"notifText": null,
"version": 2,
"_explicitType": "InProductVO"
}
],
"message": "success",
"revisionNo": -1,
"errorCode": -1,
"errorDetails": null,
"_explicitType": "Response"
}
运行json.loads(数据)不断抛出错误,嫌疑人是转义双引号,我无法驯服它。知道我该怎么解决这个问题?
答案 0 :(得分:2)
它是有效的json。
您所做的可能是将其粘贴到带有错误引号的字符串中。
如果将其粘贴到这样的原始字符串中:
r
它运作正常。请注意字符串文字上的State
Washington Seattle
Washington Seattle
前缀。
答案 1 :(得分:0)
ValueError:期待&#39;,&#39;分隔符:第1行第132列(字符131)
显然它是空位双引号。你是如何测试的?
您不能只是将字符串粘贴到&#39;&#39;中。你需要逃避反斜杠。通过打印检查数据变量,看看是否仍然存在反斜杠。
对我来说,如果保留反斜杠,它就能正常工作。