title: python xml ElementTree exception for tag not found
body: <p>I'm using ElementTree to successfully pull values from specific tags in an xml file. To add some level of protection I'd like to throw and exception if a required tag is not present.</p>
  
  <p>I found that ElementTree returns a value of "None" in place of a missing tag. But I can't even get that to work to my advantage :(</p>
  
  <pre><code>value = xmlTree.findtext('tag')
  print value
  </code></pre>
  
  <p>Will print 'None" if the tag "tag" isn't present.</p>
  
  <p>So I tried</p>
  
  <pre><code>if value == "None":
      print "tag not present"
  </code></pre>
  
  <p>But for some reason it won't catch it???</p>
  
  <p>My next thought was to see if ElementTree had a build in exception that would detect a missing tag, but had no luck with that either.</p>