问题
here's my code:
from elementTree.elementtree.ElementTree import Element, parse, ElementTree
f = open("myxml.xml", 'r')
tree = parse(f)
root = tree.getroot()
f2 = open('out.xml', 'w')
print tree
print root
props = root.findall('property')
print props
tree.write(f2)
Stacktrace:
Traceback (most recent call last):
File "xmlpy.py", line 11, in <module>
props = root.findall('property')
File "D:\user-testing-areas\DWJ\py\elementTree\elementtree\ElementTree.py", li
ne 390, in findall
return ElementPath.findall(self, path, namespaces)
TypeError: findall() takes exactly 2 arguments (3 given)
I'm following the examples given in the documentation.
http://docs.python.org/2/library/xml.etree.elementtree.html
What am I doing wrong?
来源:https://stackoverflow.com/questions/21539924/findall-takes-exactly-2-arguments-3-given