xml code is this
<foo>
<bar key="value">text</bar>
</foo>
Python code is:
import xml.etree.ElementTree as ET
xml=ET.fromstring(contents)
xml.find('./bar').attrib['key']
Output: 'value'
What must be placed in contents place of the above python code to get the value as output?
If i write as contents only it is giving an error as contents not defined.