Created
December 10, 2009 01:10
-
-
Save Kobold/253014 to your computer and use it in GitHub Desktop.
This file contains 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
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