def serialize_html_fragment(el, skip_outer=False):
 assert (not isinstance(el, basestring)), ('You should pass in an element, not a string like %r' % el)
 html = etree.tostring(el, method='html', encoding=_unicode)
 if skip_outer:
  html = html[(html.find('>') + 1):]
  html = html[:html.rfind('<')]
  return html.strip()
 else:
  return html

def serialize_html_fragment ( el , skip_outer = False ) : assert ( not isinstance ( el , basestring ) ) , ( 'You should pass in an element, not a string like %r' % el ) html = etree . tostring ( el , method = 'html' , encoding = _unicode ) if skip_outer : html = html [ ( html . find ( '>' ) + 1 ) : ] html = html [ : html . rfind ( '<' ) ] return html . strip ( ) else : return html
serialize a single lxml element as html .