title: Parse multiple XML although not all files have the elements with python
body: <p>this is my code, and i have some problem..</p>
  
  <pre><code>from xml.dom import minidom
  openFiles = 'myxml/*.xml'
  
  list = []
  
  for xmlfiles in glob.glob(openFiles):
      doc = minidom.parse(xmlfiles)
      root = doc.getElementsByTagName("info")[0]
      project_name = root.getAttribute('project_name')
      list.append(project_name)
      ....
  </code></pre>
  
  <p>This code is working properly. But somehow because I run to open multiple files its error. The cause is because not all files that have 'info' elements. So is there a way to make it keep run and change it to 'none'?</p>
  
  <p>So example become like this</p>
  
  <p>project1, project2, none, project3, none    </p>
  
  <p>Sorry for my bad english, and thank you in advance</p>