Qualcosa cosÃ?
from lxml import etree
root = etree.parse('x.xml')
result=""
for element in root.xpath('//a/tr'):
for single in element:
result=result+str(single.text)
result=result+"/n"
print(result)
MS
Il 04/06/2015 20:54, Dario Vinella ha scritto:
Potresti provare lxml-xpath2-functions
In [9]: tree.xpath('string-join(//a/tr[1]/td, "")')
Out[9]: '1985'
_______________________________________________
Python mailing list
[email protected]
http://lists.python.it/mailman/listinfo/python
_______________________________________________
Python mailing list
[email protected]
http://lists.python.it/mailman/listinfo/python