我正在使用這樣的 python 請(qǐng)求查詢 API...url = "www.example.com"response = requests.request("POST", url)response--------[ { "id": "485744", "descript": "firstitem", }, { "id": "635456", "descript": "seconditem", }, { "id": "765554", "descript": "thirditem", },]我正在嘗試像這樣訪問響應(yīng)中的第一項(xiàng)...response = response.jsonprint(response[0])但我收到錯(cuò)誤...TypeError: 'method' object is not subscriptable我哪里錯(cuò)了?
Python從請(qǐng)求響應(yīng)中獲取第一項(xiàng)
慕蓋茨4494581
2023-03-08 16:27:08