I'm trying to parse this: http://www.codespot.blogspot.in/atom.xml?redirect=false&start-index=1&max-results=500
Problem being:
I've to store the xml in a file for ElementTree to parse it. How to avoid it and just parse the string response from the GET request?
Though I'm doing this, to get all the titles, it still doesn't work:
f = open('output.xml','wb+') f.write(r.content) f.close() tree = "" with open('output.xml', 'rt') as f: tree = ElementTree.parse(f) print tree root = tree.getroot() for elem in tree.iter(): print elem.tag, elem.attrib for atype in tree.findall('title'): print atype.contents