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
twfy_person_id | name | mnis_person_id | |
---|---|---|---|
10001 | Diane Abbott | 172 | |
10003 | Irene Adams | 631 | |
10004 | Nick Ainger | 537 | |
10005 | Bob Ainsworth | 306 | |
10006 | Peter Ainsworth | 99 | |
10007 | Richard Allan | 397 | |
10008 | Graham Allen | 364 | |
10009 | David Amess | 44 | |
10010 | Michael Ancram | 259 |
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
library(xml2) | |
members <- read_xml("http://data.parliament.uk/membersdataplatform/services/mnis/members/query/membership=all|house=Commons") | |
start_dates <- xml_text(xml_find_all(xml_find_all(members, "Member"),"HouseStartDate")) | |
start_dates <- as.Date(start_dates) | |
table(start_dates > as.Date("1945-01-01")) |
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
<?xml version="1.0" encoding="iso-8859-1"?> | |
<twfy><info><s>gid:debate/2008-05-14b.1370.1</s><results_per_page>20</results_per_page><page>1</page><first_result>1</first_result><total_results>1</total_results><spelling_correction></spelling_correction></info><searchdescription>gid:debate/2008-05-14b.1370.1</searchdescription><rows><match><gid>2008-05-14b.1370.1</gid><hdate>2008-05-14</hdate><htime>11:30:00</htime><section_id>14015375</section_id><subsection_id>14015395</subsection_id><htype>12</htype><major>1</major><minor>0</minor><person_id>10651</person_id><hpos>31</hpos><video_status>5</video_status><epobject_id>14015405</epobject_id><body><p pid="b.1370.1/1">The hon. Gentleman is right to draw the attention of the House to the 18th IMC report, which deals with matters relating to organised crime, too. I am sure that he will have noted that significant progress has been made on a number of fronts. However, it is perfectly clear that in one specific area&#8212;that is, in relation to & |
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
All data taken from https://t.co/rSOl6mIDgf | |
Please attribute any usage to Ipsos MORI |
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
############################################# | |
### A very messy example of scraping in R ### | |
############################################# | |
rm(list=ls()) # Remove everything from your current workspace | |
###################### | |
### Load libraries ### | |
###################### |