from xml.etree import ElementTree import requests def get_xml_elements(response: requests.Response, element: str) -> list: """ list of a specific element in XML reponse """ root = ElementTree.fromstring(response.content) return [i.text for i in root.iter("*") if i.tag == element]
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter