Skip to content

Instantly share code, notes, and snippets.

@rdegges
Created March 16, 2010 17:42
Show Gist options
  • Save rdegges/334280 to your computer and use it in GitHub Desktop.
Save rdegges/334280 to your computer and use it in GitHub Desktop.
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