I put together a simple Python script to print out XML data for all package names that are associated with parent element attribute: Security Advisory.
import xml.etree.ElementTree as ET
tree = ET.parse('errata.xml')
root = tree.getroot()
for security in root.findall("*[@type='Security Advisory']"):
packages = security.find('packages')
print(packages.text)
The XML data is located here
However, the script only prints out the first package name but there are multiple package names. How would I go about getting all the package names that fall under parent attribute: Security Advisory?
findallinstead offind?