[Tutor] small ElementTree problem

Stefan Behnel stefan_ml at behnel.de
Fri Jan 28 14:16:20 CET 2011


Alex Hall, 28.01.2011 14:09:
> On 1/28/11, Stefan Behnel wrote:
>> Alex Hall, 27.01.2011 23:23:
>>>    self.id=root.find("id").text
>>> self.name=root.find("name).text
>>
>> There's a findtext() method on Elements for this purpose.
>>
> I thought that was used to search for the text of an element? I want
> to get the text, whatever it may be, not search for it. Or am I
> misunderstanding the function?

What do you think 'find()' does? Use the Source, Luke. ;)

Stefan



More information about the Tutor mailing list