Skip to content

Instantly share code, notes, and snippets.

@Kobold
Created December 10, 2009 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kobold/253014 to your computer and use it in GitHub Desktop.
Save Kobold/253014 to your computer and use it in GitHub Desktop.
import urllib
from xml.dom import minidom
from xml.dom.minidom import parse, parseString
display_tags = ["d:PartitionKey", "d:RowKey", "d:TimeStamp", "d:entityid",
"d:name", "d:address", "d:weburl", "d:gis_id", "d:gender",
"d:offensedescription"]
def GetData():
url = "http://ogdi.cloudapp.net/v1/dc/JuvenileArrestsCharges/?$filter=gender%20eq%20'F'"
xmldoc = minidom.parse(urllib.urlopen(url))
contentNodes = xmldoc.getElementsByTagName("content")
for contentNode in contentNodes:
for tag in display_tags:
for node in contentNode.getElementsByTagName(tag):
print node.childNodes[0].nodeValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment