Skip to content

Instantly share code, notes, and snippets.

View StanGirard's full-sized avatar
💠

Stan Girard StanGirard

💠
View GitHub Profile
@StanGirard
StanGirard / Parsing an API XML Response Data
Created February 27, 2020 22:06
Parsing an API XML Response Data - Python
import requests
import xml.etree.ElementTree as ET
r = requests.get('https://www.washingtonpost.com/arcio/news-sitemap/')
print(r.content)
xmlDict = {}
root = ET.fromstring(r.content)
for child in root.iter('*'):
print(child.tag)
for sitemap in root:
children = sitemap.getchildren()