I am using ElementTree to parse an XML file. Some fields will display HTML data. For example, consider the expression as follows:
<Course> <Description>Line 1<br />Line 2</Description> </Course>
Now, assuming _course is the Element variable that holds this Couse element. I want to access this course description, so I:
desc = _course.find("Description").text;
But then desc contains only "Line 1". I read something about the .tail attribute, so I also tried:
desc = _course.find("Description").tail;
And I get the same result. What should I do to describe Line 1
Line 2 "(or literally anything between and)? In other words, I'm looking for something similar to the .innerText property in C # (and many other languages, which I suppose).
source share