import lxml.html html = lxml.html.fromstring('''\

Hi !

''') for el in html: print(el.text)