v/pol
1
0
mirror of https://github.com/taroved/pol synced 2025-05-21 00:20:22 -07:00

attributes

This commit is contained in:
Alexandr Nesterenko 2017-11-13 23:06:29 +03:00
parent e02f4f0d1b
commit 6db89fcbe1

View File

@ -47,7 +47,7 @@ class Downloader(object):
def html2json(self, el):
return [
el.tag,
{"tag-id": el.attrib["tag-id"]},
{k: v for (k,v) in el.items()}, # attributes
[self.html2json(e) for e in el.getchildren() if isinstance(e, etree.ElementBase)]
]