from lxmlimport etree
html= '''
? ? ? ? 我左青龍,
? ? ? ? ? ? 右白虎,? ? ? ? ? ? <u1>上朱雀,? ? ? ? ? ? ? ? <li>下玄武。
? ? ? ? ? ? 老牛在當(dāng)中,
? ? ? ? 龍頭在胸口。
'''
selector= etree.HTML(html)
content1= selector.xpath('//div[@id="test3"]/span/text()')
print(content1)
for xin content1:
? ? print(x)