So I have a JSON that looks like this:
[
{
"Domain": "apple.com",
"A": [
"17.142.160.59",
"17.172.224.47",
"17.178.96.59"
],
"NS": [
"c.ns.apple.com.",
"b.ns.apple.com.",
"a.ns.apple.com.",
"f.ns.apple.com.",
"nserver5.apple.com.",
"nserver6.apple.com.",
"d.ns.apple.com.",
"e.ns.apple.com."
]
}
]
While I can retrieve the nested information manually like viz.
print(data[0]["Domain"]) --- Returns: apple.com
print(data[0]["A"][0]) --- Returns: 17.142.160.59
How can I loop through the information that let me retrieve the Domain, the the nested Ainformation, the nested
NS` information etc.?
I tried doing this:
for i in data["Domain"]:
print(data[i]["Domain"])
for j in ... // could not figure out, either way first loop fails.
in vain. Thanks for any help!