1
我目前正在解析维基百科转储,试图提取一些有用的信息。解析发生在XML中,我只想提取每个页面的文本/内容。现在我想知道如何在另一个标签内的标签内找到所有文本。我搜索了类似的问题,但只发现了单个标签有问题的问题。这里是什么,我想实现一个例子:Python:从XML树中的标记中提取文本
<revision>
<timestamp>2001-01-15T13:15:00Z</timestamp>
<contributor>
<username>Foobar</username>
<id>65536</id>
</contributor>
<comment>I have just one thing to say!</comment>
<text>A bunch of [[text]] here.</text>
<minor />
</revision>
<example_tag>
<timestamp>2001-01-15T13:15:00Z</timestamp>
<contributor>
<username>Foobar</username>
<id>65536</id>
</contributor>
<comment>I have just one thing to say!</comment>
<text>A bunch of [[text]] here.</text>
<minor />
</example_tag>
我怎样才能提取文本标签中的文本,但只有当它被包含在版本树?