I am trying to write a small script for interacting with the last.fm API.
I have a small bit of experience working with ElementTree
, but the way I used
The problem is that findall
only searches the immediate descendants of an element if it is given a tag name. You need to give it an XPath expression that will find track
anywhere in the tree beneath it. So the following should work, for example:
api_results = ElementTree.parse(response).findall('.//track')