title: Minidom - iterate through attributes and get their value
body: <p>I have the following code which tries to fetch the value of feature attribute tag in XML;</p>
  
  <pre><code>from xml.dom import minidom
  xmldoc = minidom.parse('P38398.xml')
  itemlist = xmldoc.getElementsByTagName("feature")
  for s in itemlist:
      description = s.attributes['description'].value
      print description
  </code></pre>
  
  <p>This loop gives me the following error. Why?</p>
  
  <pre><code>Traceback (most recent call last):
  File "test.py", line 5, in &lt;module&gt;
  description = s.attributes['description'].value
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/minidom.py", line 522, in __getitem__
  return self._attrs[attname_or_tuple]
  KeyError: 'description'
  </code></pre>
  
  <p>What am I doing wrong here? Any help will be appreciated. Thanks. Below is the XML file.</p>
  
  <pre><code>&lt;root&gt;
      &lt;entry&gt;
        &lt;accession&gt;A&lt;/accession&gt;
          &lt;feature type="cross-link" description="sumo2"&gt;
              &lt;location&gt;
                  &lt;position position="15111992"/&gt;
              &lt;/location&gt;
          &lt;/feature&gt;
          &lt;feature type="cross-link" description="sumo"&gt;
              &lt;location&gt;
                  &lt;position position="22345"/&gt;
              &lt;/location&gt;
          &lt;/feature&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
        &lt;accession&gt;X&lt;/accession&gt;
          &lt;feature type="test" description="testing"&gt;
              &lt;location&gt;
                  &lt;position position="1"/&gt;
              &lt;/location&gt;
          &lt;/feature&gt;
          &lt;feature type="cross-link" description="sumo hello"&gt;
              &lt;location&gt;
                  &lt;position position="11223344"/&gt;
              &lt;/location&gt;
          &lt;/feature&gt;
      &lt;/entry&gt;
  &lt;/root&gt;
  </code></pre>