xml_content = <root><para>Brother set had private his letters observe outward resolve. Shutters ye marriage to throwing we as. <child1>Effect in if agreed he wished wanted admire expect</child1>. Or shortly visitor is comfort <child2>placing to cheered do</child2>. Few hills tears are weeks saw. Partiality insensible celebrated is in. Am <child3>offended as wandered</child3>thoughts greatest an friendly. Evening covered in he exposed fertile to. Horses seeing at played plenty nature to expect we. Young say led stood hills own thing get</para></root>
.
Hi, I would like to slurp everything with in the and be able to access Young
with in the para. the lil script I have got gets only until “Brother set had private his letters observe outward resolve. Shutters ye marriage to throwing we as.”
this is my script :
parser = ET.XMLParser(remove_blank_text=True)
root = ET.XML(xml_content, parser=parser)
# Function to deep copy an element
def get_deep_copy(element):
return copy.deepcopy(element)
# Extract and print the <para> elements
new_para_elements = [get_deep_copy(para) for para in root.findall('.//para')]
# Printing the lxml elements
for elem in new_para_elements:
print(elem.text)
xml_content is the