def getInnerText(node):
 inner_text = []
 for child in node.childNodes:
  if ((child.nodeType == child.TEXT_NODE) or (child.nodeType == child.CDATA_SECTION_NODE)):
   inner_text.append(child.data)
  elif (child.nodeType == child.ELEMENT_NODE):
   inner_text.extend(getInnerText(child))
  else:
   pass
 return ''.join(inner_text)

def getInnerText ( node ) : inner_text = [ ] for child in node . childNodes : if ( ( child . nodeType == child . TEXT_NODE ) or ( child . nodeType == child . CDATA_SECTION_NODE ) ) : inner_text . append ( child . data ) elif ( child . nodeType == child . ELEMENT_NODE ) : inner_text . extend ( getInnerText ( child ) ) else : pass return '' . join ( inner_text )
get all the inner text of a dom node .