def get_inner_html_from_xpath(xpath_node):
 html = etree.tostring(xpath_node).strip()
 inner_html = re.sub(('(?ms)<%s[^>]*>(.*)</%s>' % (xpath_node.tag, xpath_node.tag)), '\\1', html)
 return inner_html.strip()

def get_inner_html_from_xpath ( xpath_node ) : html = etree . tostring ( xpath_node ) . strip ( ) inner_html = re . sub ( ( '(?ms)<%s[^>]*>(.*)</%s>' % ( xpath_node . tag , xpath_node . tag ) ) , '\\1' , html ) return inner_html . strip ( )
returns inner html as string from xpath node .