I'm trying to parse an XML document so that I only get the text inside the tag , but when I test-print the node, it's only showing square brackets, which means that my command print(rede.text) returns "AttributeError: 'list' object has no attribute 'text'". Why is the XML-content stored as a list object and how I can access the text inside the tag?
import os
from xml.etree import ElementTree
file_name = '19008-data.xml'
full_file = os.path.abspath(os.path.join('WP19_Protokolle_2018-2020',file_name))
dom = ElementTree.parse(full_file)
redner = dom.findall('rede')
print(redner)
output: [ ]
import os
from xml.etree import ElementTree
file_name = '19008-data.xml'
full_file = os.path.abspath(os.path.join('WP19_Protokolle_2018-2020',file_name))
dom = ElementTree.parse(full_file)
redner = dom.findall('rede')
print(redner.text)
AttributeError: 'list' object has no attribute 'text'
