refer to xpath attributes generally

Sayth Renshaw flebber.crue at gmail.com
Thu May 28 19:20:40 EDT 2015


Is there a way to specify to all attributes in xpath? Instead of directly Eg //element/@attr

So that you could effectively loop and filter if an element had more than one Attribute?

So items = tree.xpath(@all_attrs)

>From lxml import etree 

Tree = etree.Xpath(//root)

For k, v in items:
    Choose your k's


Thanks for your time in advance
Please forgive some formatting errors phone auto correct 
Sayth



More information about the Python-list mailing list