I am working on xml file of 210mb size using python. The data contain Nonetype and it give error as "TypeError: 'NoneType' object is not iterable"
import xml.etree.ElementTree as etree
nsmap = {}
lis = []
for event, elem in etree.iterparse("data_1.xml", events=('start-ns', 'end-ns'), remove_blank_text=True):
try:
print event, elem
ns, url = elem
#filter(None, lis)
except ValueError:
nsmap[ns] = url
print nsmap
TypeError Traceback (most recent call last)
<ipython-input-23-23b2c0b682e8> in <module>()
4 try:
5 print event, elem
----> 6 ns, url = elem
7 #filter(None, lis)
8 except ValueError:
TypeError: 'NoneType' object is not iterable
Don't how to solve it. I just want to print the data. Even without using try and except method it show same error.