You must understand the structure. Simple test:
Of course, one can print data outright and try to understand the structure :-).
import plistlib as pl with open('Bookmarks_example.xml', 'rb') as f: data = pl.load(f) for i, (key, value) in enumerate(data.items(), start=1): print(f'{i}. Key: {key}, value type: {type(value)}')Which will display:
Output:1. Key: Children, value type: <class 'list'>
So there is one key which has value of list type. Lets look what types does this list contains:for i, item in enumerate(data['Children'], start=1): print(f'{i}.{type(item)}')
Output:1.<class 'dict'>
2.<class 'dict'>
So there are two dictionaries in this list. What keys does these dictionaries have:for i in range(2): print(f'{", ".join(data["Children"][i].keys())}')
Output:Title, WebBookmarkIdentifier, WebBookmarkType, WebBookmarkUUID
Children, Sync, Title, WebBookmarkFileVersion, WebBookmarkType, WebBookmarkUUID
...and so on.Of course, one can print data outright and try to understand the structure :-).
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.