I have many rows in a file that contains xml and I'm trying to write a Python script that will go through those rows and count how many instances of a particular node attribute show up. For instance, my tree looks like:
<foo> <bar> <type name="controller">A</type> <type name="channel">12</type> </bar> </foo>
I want to get text of line with 'name="controller"'. In the above xml text, I need to receive "A" and not "controller".
I used xml.etree.ElementTree
but it shows me the value of name attribute that is "controller".