I'm trying to run Xpath queries using etree, but I can't seem to figure out the Xpath syntax. Here's a (sanitized) section of my XML document. 1) Query using XML based on some value like the 'id' or ...
#result=tree.xpath('/html/body/ul/li/a/text()') #result=tree.xpath('/html/body/ul/li[1]/a/text()') #xpath从1开始数,[]表示索引 #result=tree.xpath("/html/body ...