refer to xpath attributes generally

2015-05-28 Thread Sayth Renshaw
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:

Re: refer to xpath attributes generally

2015-05-28 Thread Sayth Renshaw
On Friday, 29 May 2015 09:21:01 UTC+10, Sayth Renshaw wrote: 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