Parsing Xml files >3gb using lxml etree iterparse [duplicate]

拜拜、爱过 提交于 2021-02-11 13:49:22

问题


I am not able to parse XML file of huge size using lxml tree. What I came to know from my research is that lxml iterparse loads the xml file until it gets tag which it is looking for. This is snippet of my code :-

for event, child in etree.iterparse(xml_file,tag='test'):
        print(sys.getsizeof(child))

It is not even reaching print statement and is getting killed. Any help on this matter?

来源:https://stackoverflow.com/questions/61813902/parsing-xml-files-3gb-using-lxml-etree-iterparse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!