Aug-15-2022, 01:29 PM
Hello, I am not very good with python currently. I am trying to pull data from a json file. I have found seeral examples but nothing seems to work for me. The examples seem to work with the example file. When I try to use my file I get an error "list indices must be integers or slices, not dict". For example this works as expected https://pythonguides.com/json-data-in-python/. When I change the file name to load my file it throws that error. This is very frustrating. There are a lot of these sections. If anyone can point me to an article or can explain how to do what I want. Which is just extract all the urls out of the file. Thank you.
Los of these sections
"kind": "some text"
"Entries": [
This is a small example of the json file I am trying to manipulate:
Los of these sections
"kind": "some text"
"Entries": [
This is a small example of the json file I am trying to manipulate:
[ { "kind": "Symantec Endpoint Protection client/ Symantec Agent", "entries": [ { "date": "2021-06-14", "url": "https://liveupdate.symantec.com", "description": "Agent Installation Package", "inbound": false, "outbound": true }, { "date": "2021-06-14", "url": "https://liveupdate.symantecliveupdate.com", "description": "Agent Installation Package", "inbound": false, "outbound": true }, { "date": "2021-06-14", "url": "https://ent-shasta-rrs.symantec.com", "description": "Symantec reputation servers", "inbound": false, "outbound": true }, "outbound": true } ] }, { "kind": "Additional Entries for Cloud Managed/ Hybrid managed Agents", "entries": [ { "date": "2021-06-14", "url": "https://usea1.r3.securitycloud.symantec.com", "description": "Symantec Cloud API gateway", "inbound": false, "outbound": true }, { "date": "2021-06-14", "url": "https://us.spoc.securitycloud.symantec.com", "description": "Cloud notification service (SPOC)", "inbound": false, "outbound": true }, { "date": "2021-06-14", "url": "https://storage.googleapis.com", "description": "Cloud storage services, Live Shell", "inbound": false, "outbound": true }, { "date": "2021-06-14", "url": "https://ws.securitycloud.symantec.com", "description": "Live Shell", "inbound": false, "outbound": true }, { "date": "2021-06-14", "url": "https://bds.securitycloud.symantec.com", "description": "Live Shell", "inbound": false, "outbound": true } ] },