Get specific text from xml using python
<p>I have an XML string which looks like this:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:geonode="http://www.geonode.org/" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" targetNamespace="http://www.geonode.org/"&gt;
  &lt;xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://localhost:8080/geoserver/schemas/gml/3.1.1/base/gml.xsd"/&gt;
  &lt;xsd:complexType name="test_24Type"&gt;
    &lt;xsd:complexContent&gt;
      &lt;xsd:extension base="gml:AbstractFeatureType"&gt;
        &lt;xsd:sequence&gt;
          &lt;xsd:element maxOccurs="1" minOccurs="0" name="attribute_1" nillable="true" type="xsd:string"/&gt;
          &lt;xsd:element maxOccurs="1" minOccurs="0" name="the_geom" nillable="true" type="gml:MultiLineStringPropertyType"/&gt;
        &lt;/xsd:sequence&gt;
      &lt;/xsd:extension&gt;
    &lt;/xsd:complexContent&gt;
  &lt;/xsd:complexType&gt;
  &lt;xsd:element name="test_24" substitutionGroup="gml:_Feature" type="geonode:test_24Type"/&gt;
&lt;/xsd:schema&gt;
</code></pre>

<p>What I want to do is to use Python in order to extract the url corresponding to xmlns:geonode:</p>

<pre><code>"http://www.geonode.org/"
</code></pre>

<p>I know there is this library: from xml.etree import cElementTree as ET
But I am not sure how to use it properly in order to extract information which is on this element.</p>

<p>The following is one of the ways to extract data from xml file using xml.etree library and python 2.7.
Replace the xml file name and the tag name in the corresponding places in the code.</p>

<pre><code>import xml.etree.ElementTree as XT
dataTree = XT.parse('your_xml_file_name.xml')
dataRoot = dataTree.getroot()
geoNode = dataRoot.find('your_tag_name').text
print geoNode
</code></pre>

python xml