In my xml example
<sample>
<para>This text is sample paragraph with <url>https://www.google.com</url>. Thank you!</para>
</sample>
I would like to extract the following sentence from xml using python3.
This text is sample paragraph with https://www.google.com/. Thank you!
So I used Python 3 code as below.
# Sample.py
# root = xml root, xml = xml namespace
description = root.findall('./{0}sample/{0}para'.format(namespace))
for i in description:
print(i.text)
But, Sample.py code above was very different from the output I wanted.
# Sample.py Output
This text is sample paragraph with
How can I print the text that includes the value in the url tag I want? (*It excludes simply using findall() func and attaching url(i.e., the location of url tags is unknown).)