import requests
import xml.etree.ElementTree as ET
index_r = requests.get('https://www.soppa365.fi/sitemap.xml')
index_xml = index_r.text
index_tree = ET.fromstring(index_xml)
for page_url in index_tree.findall('{http://www.sitemaps.org/schemas/sitemap/0.9}sitemap'):
page_url = page_url.find('{http://www.sitemaps.org/schemas/sitemap/0.9}loc').text
r = requests.get(page_url)
xml = r.text
tree = ET.fromstring(xml)
for url in tree.findall('{http://www.sitemaps.org/schemas/sitemap/0.9}url'):
resepti_url = url.find('{http://www.sitemaps.org/schemas/sitemap/0.9}loc').text
if 'reseptit/kasvis' in resepti_url:
print(resepti_url)
Got more recipies. Text file generated with: