Pages
Home
About
Comments
Projects
Web
Learn Huge
Pentesting Lab
Mobile
Move Tiles
Velocity Ruler
Workaholic
Zombie Crush
Categories
Algorithm
Android
Cloud
GDAL
Git
Linux
Machine Learning
Math
Mobile
Network
Pelican
Python
R
System Design
Web
Computer Science Mojo
~ David's Notes on coding, software and computer science
Tag: Coding
How to check tag exists when parsing XML in Python
Category:
Python
Tag:
Coding
Errors
Python
XML
By:
David
On:
Tue 28 July 2015
When using Python minidom to parse XML it is easy to encounter an "IndexError: list index out of range" if the tag does not exit. An easy fix is to check the size of "doc.getElementsByTagName".
Continue reading »