#coding=utf-8 import sys try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET if __name__ == '__main__': if len(sys.argv) == 1: exit(1) xmlfile = sys.argv[1] tree = ET.ElementTree(file=xmlfile) for child in tree.findall('ql'): print child.text;
<HiveQL > <ql>fff</ql> </HiveQL>