Viktor Petersson logo

Blog

How to parse and dump a sitemap

31 MAR • 2015 1 minute

When deling with website migrations, you sometimes need to map out the old content such that you can create your redirect to the new pages.

While doing this, I ran across this little helpful snippet.

Just modify the URL to the sitemap and the script will print out all the pages. You will need BeautifulSoup 4 and Requests.

Found an error or typo? File PR against this file.