content = etree.HTML(text)
h = content.xpath('//h1')
h1 = h[0].xpath('string(.)').strip()

 

相关文章: