Ich bin ein Newb mit JSON und versuche zu verstehen, wie eine JSON-Antwort zu analysieren. Im folgenden Beispiel würde ich gerne wissen, wie man den Wert von 'issueId' abruft: 'executions': 'id'? im Beispiel unten ist '8195' .....Python Analyse JSON Antwort
r = requests.get(baseURL + getExecutionsForIssueId + id, auth=('user','pass'))
data = r.json()
JSON Response:
{
"status": {
"1": {
"id": 1,
"color": "#75B000",
"description": "Test was executed and passed successfully.",
"name": "PASS"
},
"2": {
"id": 2,
"color": "#CC3300",
"description": "Test was executed and failed.",
"name": "FAIL"
},
"3": {
.
.
.
}
},
"issueId": 15825,
"executions": [
{
"id": 8195,
"orderId": 7635,
"executionStatus": "-1",
"comment": "",
"htmlComment": "",
.
.
.
'data [ 'issueId']'? –
Ich habe gerade eine Frage sehr ähnlich beantwortet, die Ihnen [für komplexere json] helfen könnte (http://stackoverflow.com/questions/38978428/how-do-i-start-pulling-apart-this-block-of-json -data/38979645 # 38979645). Es gibt viele Beispiele für diese Art von Dingen. – roganjosh