[Solved] IndexError: list index out of range error [duplicate]


You are parsing XML that doesn’t have child nodes for that specific slidename[a] element. You probably want to skip that one.

You are not using Python loops to their full potential. There is no need to loop over indices when you can loop directly over the list itself:

for a in tagname:
    try:
        print a.childNodes[0].nodeValue
    except IndexError:
        print 'No childNodes for this element'

0

solved IndexError: list index out of range error [duplicate]