Hey all,
This is probably a simple problem to fix but I've been frantically googling and can't find anything to fix the problem I've been having.
I'm currently using Python to receive the feed from the Darwin push ports and while I can easily get python to print certain elements of the XML I'm struggling to access the any that have a colon for example from the below "ns3:Location".
I have been using xmltodict,
I'm fairly new to XML never really touched it so any help would be greatly appreciated any links for further reading :D.
The code I am using:
p = xmltodict.parse(XML)
uid = p['Pport']['uR']['TS']['@uid']
ssd = p['Pport']['uR']['TS']['@ssd']
print uid, ssd
If I try using the above to access the tiploc
locationA = p['Pport']['uR']['TS']['ns3:Location']['@tpl']
print uid, ssd, locationA
This sometimes prints out the tipoc but other times I receive the error message "typeError: list indices must be integers, not str"