Jul-12-2020, 06:02 PM
Here one with BS as i never use ElementTree(has caused a lot of unnecessary problems for many people trough the years).
from bs4 import BeautifulSoup soup = BeautifulSoup(open('comp.xml'), 'xml') for row in soup.find_all('row_element'): print(row.text)
Output:VALUE_STR_1
VALUE_STR_2
VALUE_STR_3
VALUE_STR_4
VALUE_STR_5
VALUE_STR_6
VALUE_STR_7
VALUE_STR_8
VALUE_STR_9
VALUE_STR_10