Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我无法使用 lxml 树解析巨大的 XML 文件。我从我的研究中了解到,lxml iterparse 会加载 xml 文件,直到它获得它正在寻找的标签。这是我的代码片段:-
for event, child in etree.iterparse(xml_file,tag='test'): print(sys.getsizeof(child))
它甚至没有达到打印声明并且正在被杀死。在这件事上有什么帮助吗?