title: python - lxml how to get children of element by tag name?
body: <p>I have a xml file that looks like this:</p>
  
  <pre><code>&lt;page&gt;
      &lt;title&gt;title1&lt;/title&gt;
      &lt;subtitle&gt;subtitle&lt;/subtitle&gt;
      &lt;ns&gt;0&lt;/ns&gt;
      &lt;id&gt;1&lt;/id&gt;
      &lt;text&gt;hello world!@&lt;/text&gt;
  &lt;/page&gt;
  &lt;page&gt;
      &lt;title&gt;title2&lt;/title&gt;
      &lt;ns&gt;0&lt;/ns&gt;
      &lt;id&gt;1&lt;/id&gt;
      &lt;text&gt;hello world&lt;/text&gt;
  &lt;/page&gt; 
  </code></pre>
  
  <p>How can I get the text of each page? Right now I have a list of each page. The following code will print the text of the second page element but not the first. Is there a way to take the child element by tag name like <code>element['text']</code></p>
  
  <pre><code>for i in pages:
      print i[3]
  </code></pre>