Created
March 16, 2010 17:42
-
-
Save rdegges/334280 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
response = 'some xml response here' | |
try: | |
doc = etree.XML(response.strip()) | |
code = doc.findtext('code') | |
print code | |
except etree.XMLSyntaxError: | |
print 'XML parsing error.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment