title: How to find a string inside a XML like tag from a file in Python?
body: <p>I have a RDF document, which looks like as follows:</p>
  
  <pre><code>&lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
   xmlns:cd="http:xyz.com#"&gt;
  
  &lt;rdf:Description rdf:about="http:xyz.com#"&gt;
      &lt;cd:algorithmid&gt;DPOT-5ab247867d368&lt;/cd:algorithmid&gt;
      &lt;cd:owner&gt;arun&lt;/cd:owner&gt;
      &lt;cd:acesskey&gt;ACCESS-5ab247867d370&lt;/cd:acesskey&gt;
      &lt;cd:purpose&gt;Research&lt;/cd:purpose&gt;
      &lt;cd:metadata&gt;10&lt;/cd:metadata&gt;
      &lt;cd:completeness&gt;Partial&lt;/cd:completeness&gt;
      &lt;cd:completeness&gt;Yes&lt;/cd:completeness&gt;
      &lt;cd:inclusion_1&gt;age&lt;/cd:inclusion_1&gt;
      &lt;cd:feature_1&gt;Sex&lt;/cd:feature_1&gt;
      &lt;cd:target&gt;Diagnosis&lt;/cd:target&gt;
  &lt;/rdf:Description&gt;
  
  &lt;/rdf:RDF&gt; 
  </code></pre>
  
  <p>From the above texts, I need to extract the target (i.e. only the value inside the opening and closing "cd:target" tag). The desired output should be 'Diagnosis'. I tried with XML parser but it does not work because of the tree contains ':'. Any better solution, please? </p>
  
  <p>Update: This is the I tried, sorry for naive coding style. </p>
  
  <pre><code>import xml.etree.ElementTree as et
  
  def metadataParser(metadataFile):
      with open(metadataFile, 'r') as m:
          data = m.read() 
          # Load the xml content from a string
          content = et.fromstring(data)       
          description = content.find('rdf:Description')
          target = description.find("cd:target")
  
      return target   
  
  
  target = metadataParser('metadata.rdf')
  print(target)
  </code></pre>