当我从URL导入JSON时,它表示它有一个额外的字符。以下是:
代码:
import requests
import json
response = json.loads(requests.get("https://s3-us-west-2.amazonaws.com/anand-fhir-json/2e3b7aa0-0c90-4b31-8967-680f1438e03e").text)
print(res1);
JSON格式:
{"id":{"s":"2"},"managingOrganization":{"s":"{'reference': 'Organization/hl7'}"},"address":{"s":"[{'use': 'home', 'line': ['2222 Home Street']}]"},"name":{"s":"[{'use': 'official', 'family': 'Everyman', 'given': ['Adam']}]"},"telecom":{"s":"[{'system': 'phone', 'value': '555-555-2004', 'use': 'work'}]"},"gender":{"s":"male"},"active":{"s":"true"},"birthDate":{"s":"null"},"meta":{"s":"{'lastUpdated': '2012-05-29T23:45:32Z'}"},"resourceType":{"s":"Patient"}}
{"id":{"s":"8"},"managingOrganization":{"s":"{'reference': 'Organization/hl7'}"},"address":{"s":"[{'use': 'home', 'line': ['4444 Home Street']}]"},"name":{"s":"[{'use': 'official', 'family': 'Mum', 'given': ['Martha']}]"},"telecom":{"s":"[{'system': 'phone', 'value': '555-555-2006', 'use': 'work'}]"},"gender":{"s":"female"},"active":{"s":"true"},"birthDate":{"s":"null"},"meta":{"s":"{'lastUpdated': '2012-05-29T23:45:32Z'}"},"resourceType":{"s":"Patient"}}