Can Python xml ElementTree parse a very large xml file?

前端 未结 5 2019
误落风尘
误落风尘 2020-12-17 19:45

I\'m trying to parse a large file (> 2GB) of structured markup data and the memory is not enough for this.Which is the optimal way of XML parsing class for this condition.Mo

5条回答
  •  醉话见心
    2020-12-17 20:11

    Check out the iterparse() function. A description of how you can use it to parse very large documents can be found here.

提交回复
热议问题