E
E
Eugene Moldovanu2020-01-02 00:02:17
Python
Eugene Moldovanu, 2020-01-02 00:02:17

How to get xml value without nested tags?

There is a file with data in xml format. It contains many elements of the form title

<title><hlword>Страховка</hlword> <hlword>в</hlword> <hlword>Таиланд</hlword>: какая лучше по отзывам 2019 | «Онлайн...»</title>

How to get value counting nested as title text?
THAT is, at the exit, I want to get a line Insurance in Thailand: which is better according to reviews 2019 | "Online..."
How can this be done using minidom ?
I tried through items= mydoc.getElementsByTagName("title") but it doesn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ranwise, 2020-01-02
@Ranwise

read about xpath and lxml library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question