title: python3 xpath can't reach a child node (AttributeError: 'NoneType' object has no attribute 'text')
body: <p>need help with some issue I didn't manage to find<p>
  I have an xml like this:</p>
  
  <pre><code>&lt;forecast xmlns="http://weather.yandex.ru/forecast" country_id="8996ba26eb0edf7ea5a055dc16c2ccbd" part="Лен Стокгольм" link="http://pogoda.yandex.ru/stockholm/" part_id="53f767b78d8f180c28d55ebda1d07e0c" lat="59.381981" slug="stockholm" city="Стокгольм" climate="1" country="Швеция" region="10519" lon="17.956846" zoom="12" id="2464" source="Station" exactname="Стокгольм" geoid="10519"&gt;
  &lt;fact&gt;...&lt;/fact&gt;
  &lt;yesterday id="435077826"&gt;...&lt;/yesterday&gt;
  &lt;informer&gt;...&lt;/informer&gt;
  &lt;day date="2016-04-18"&gt;
      &lt;sunrise&gt;05:22&lt;/sunrise&gt;
      &lt;sunset&gt;20:12&lt;/sunset&gt;
      &lt;moon_phase code="growing-moon"&gt;14&lt;/moon_phase&gt;
      &lt;moonrise&gt;15:53&lt;/moonrise&gt;
      &lt;moonset&gt;04:37&lt;/moonset&gt;
      &lt;biomet index="3" geomag="2" low_press="1" uv="1"&gt;...&lt;/biomet&gt;
      &lt;day_part typeid="1" type="morning"&gt;...&lt;/day_part&gt;
      &lt;day_part typeid="2" type="day"&gt;...&lt;/day_part&gt;
      &lt;day_part typeid="3" type="evening"&gt;...&lt;/day_part&gt;
      &lt;day_part typeid="4" type="night"&gt;...&lt;/day_part&gt;
      &lt;day_part typeid="5" type="day_short"&gt;
          &lt;temperature&gt;11&lt;/temperature&gt;
      &lt;/day_part&gt;
  &lt;/day&gt;
  &lt;/forecast&gt;
  </code></pre>
  
  <p>(the entire xml could be reached at <a href="https://export.yandex.ru/weather-ng/forecasts/2464.xml" rel="nofollow">https://export.yandex.ru/weather-ng/forecasts/2464.xml</a>). need to get the temperature.text (11), trying this code:</p>
  
  <pre><code>import urllib.request
  import codecs
  import lxml
  from xml.etree import ElementTree as ET
  
  def gen_ns(tag):
      if tag.startswith('{'):
          ns, tag = tag.split('}') 
          return ns[1:]
      else:
          return ''
  with codecs.open(fname, 'r', encoding = 'utf-8') as t:
          town_tree = ET.parse(t)
          town_root = town_tree.getroot() 
          print (town_root)
  
          namespaces = {'ns': gen_ns(town_root.tag)}
          print (namespaces)
  
          for day in town_root.iterfind('ns:day', namespaces):
              date = (day.get('date'))
              print (date)
              day_temp = day.find('.//*[@type="day_short"]/temperature')  
              print (day_temp.text)
  </code></pre>
  
  <p>getting:</p>
  
  <pre><code>Traceback (most recent call last):
  File "weather.py", line 154, in &lt;module&gt;
      print (day_temp.text)
  AttributeError: 'NoneType' object has no attribute 'text'
  </code></pre>
  
  <p>what's wrong with my xpath? I can get attr of <code>('.//*[@type="day_short"]')</code>, but can't get its child (temperature) text
  Thanks everyone!</p>