import datetime import sitemap.generator as generator sitemap = generator.Sitemap() sitemap.add("http://www.example.com", lastmod=datetime.datetime.now(), changefreq ...
We've started by importing xml.etree.cElementTree, a built-in python package for parsing XML. Then we created a function called generate_sitemap(), in which we define XML schema info and the <urlset> ...