使用boto3在子节点上基于文本搜索打印文件名

时间:2019-01-28 21:14:24

标签: xml boto3

我有要求-基于对xml文件子节点的文本搜索,将文件名打印为输出。我已经编写了以下代码,但没有得到任何输出:

 content = elt.parse('/tmp/{}'.format(file_name)).getroot()
            #all_items = content.findall("70443783")
            #print(all_items)
            for elem in content:
              for subelem in elem.findall('StartDateTime'):

 ( start Datetime is text I want to search in child nodes of xml file)

          print(subelem.text)  or print the name of file will be fine 
             as well.

0 个答案:

没有答案