May-26-2021, 11:03 AM
Hello Community,
I have transformed my bookmarks plist file to an XML file. I try to write a script where I am able to read the XML file, getting the URL information and generate a SQLite3 file with it.
I checked the Python 3 documentation about plistlib. I tried the following
How can I get the values from <string> so I can get the URL information?
I have add an example XML file
Best regards
--Christian
I have transformed my bookmarks plist file to an XML file. I try to write a script where I am able to read the XML file, getting the URL information and generate a SQLite3 file with it.
I checked the Python 3 documentation about plistlib. I tried the following
import plistlib fileName = "Bookmarks_example.xml" print ("File: ", fileName) print (" ") with open(fileName, 'rb') as fp: pl = plistlib.load(fp) print(pl["Children"])When I try something else except Children I got a key error message
Error:python3 helper_plist-xml_2.py
File: Bookmarks_example.xml
Traceback (most recent call last):
File "/home/wchris/Python/helper_plist-xml_2.py", line 9, in <module>
print(pl["string"])
KeyError: 'string'
Is it only possible to access key values?How can I get the values from <string> so I can get the URL information?
I have add an example XML file
Best regards
--Christian
Attached Files