#import xml.etree.cElementTree as etree root.findall('country[last()]') # 最后一个country,实际上找到了所有的country root.findall('country[last()]') # 实际上找到了最后一个country

#import xml.etree.cElementTree as etree 

root.findall('country[last()]')   # 最后一个country,实际上找到了所有的country


    from lxml import etree

root.findall('country[last()]')   # 实际上找到了最后一个country

    因此建议使用新的库

猜你喜欢

转载自blog.csdn.net/u012474535/article/details/79240901