1
我需要使用lxml.html
找到标签的位置或全文。 例如:Python找到HTML标签位置
[some html code] </body > [some html code]
我需要返回:</body >
OR这段文字的位置。
我该怎么做?下面的代码不起作用。
page = fromstring(html)
for s in page.findall('.//body'):
print s.tag, s.text, s.attrib
目前还不清楚是什么 “位置或标记的全文” 的意思。 '