Skip to content

Instantly share code, notes, and snippets.

@dracos
Created Nov 29, 2013
Embed
What would you like to do?
import urllib
from lxml import etree
parl_members_xml = etree.parse(urllib.urlopen('http://data.parliament.uk/membersdataplatform/services/mnis/members/query/House=Commons%7CIsEligible=true/'))
parl_members = parl_members_xml.getroot()
print etree.tostring(parl_members.find('Member[@Member_Id="638"]'))
for member in parl_members:
if member.attrib['Member_Id'] == '638':
print etree.tostring(member)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment