D
D
Denis Kiselev2020-10-10 20:25:45
Python
Denis Kiselev, 2020-10-10 20:25:45

How to parse xml sitemap?

Greetings. tell me: there is a sitemap https://site.ru/sitemap.xml , it has the following structure:

<url>
<loc>https://site.ru/krs/catalog/brand-tank-1/people-8</loc>
<lastmod>2019-10-24</lastmod>
</url>
<url>
<loc>https://site.ru/krs/catalog/brand-tank-1/people-9</loc>
<lastmod>2019-10-24</lastmod>
</url>
<url>
<loc>https://site/krs/catalog/brand-tank-2/people-10</loc>
<lastmod>2019-10-24</lastmod>
</url>

Tell me how to make a cycle? in which we are looking for everything in which the link contains " https://site.ru/krs/catalog/brand-tank-1 " and assign this link to a variable and then work with it as you like.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2020-10-10
@fox_12

https://lxml.de/parsing.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question