title: Python ElementTree module: How to ignore the namespace of XML files to locate matching element when using the method "find", "findall"
body: <p>I want to use the method of "findall" to locate some elements of the source xml file in the ElementTree module.</p>
  
  <p>However, the source xml file (test.xml) has namespace. I truncate part of xml file as sample:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
  &lt;XML_HEADER xmlns="http://www.test.com"&gt;
      &lt;TYPE&gt;Updates&lt;/TYPE&gt;
      &lt;DATE&gt;9/26/2012 10:30:34 AM&lt;/DATE&gt;
      &lt;COPYRIGHT_NOTICE&gt;All Rights Reserved.&lt;/COPYRIGHT_NOTICE&gt;
      &lt;LICENSE&gt;newlicense.htm&lt;/LICENSE&gt;
      &lt;DEAL_LEVEL&gt;
          &lt;PAID_OFF&gt;N&lt;/PAID_OFF&gt;
          &lt;/DEAL_LEVEL&gt;
  &lt;/XML_HEADER&gt;
  </code></pre>
  
  <p>The sample python code is below:</p>
  
  <pre><code>from xml.etree import ElementTree as ET
  tree = ET.parse(r"test.xml")
  el1 = tree.findall("DEAL_LEVEL/PAID_OFF") # Return None
  el2 = tree.findall("{http://www.test.com}DEAL_LEVEL/{http://www.test.com}PAID_OFF") # Return &lt;Element '{http://www.test.com}DEAL_LEVEL/PAID_OFF' at 0xb78b90&gt;
  </code></pre>
  
  <p>Although it can works, because there is a namespace "{http://www.test.com}", it's very inconvenient to add a namespace in front of each tag.</p>
  
  <p>How can I ignore the namespace when using the method of "find", "findall" and so on?</p>