'merge bookmark files with Python 3 pyparsing

I've downloaded an older Python 3 script which should be able to merge bookmark files. But this line always produces an error. Unfortunately I am absolute beginner in Python and I am also confused by pyparsing docs.

#using a private attribute of ParseResults to associate rows with hyperlinks
hyperlinks = dict([(pos,href) for href,pos in parseresults._ParseResults__tokdict.get('HyperLink',[])])

error:

hyperlinks = dict([(pos,href) for href,pos in parseresults._ParseResults__tokdict.get('HyperLink',[])])
AttributeError: 'str' object has no attribute 'get'

Searched in the internet, but this is very special topic.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source