March 2020
Intermediate to advanced
608 pages
17h 17m
English
The process is analogous to the JSON approach. Using the requests.get() method, we read the data from Last.fm, passing the query parameters as params. The XML content of the response is passed to the ElementTree parser from the defusedxml module, and the root node is returned.
The ElementTree nodes have the find() and findall() methods, where you can pass XPath queries to filter out specific subnodes.
The following is a table of the available XPath syntax supported by ElementTree:
| XPath syntax component | Meaning |
| tag | This selects ... |