Skip to content

Commit

Permalink
WIP - include other assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Parkes committed Feb 19, 2015
1 parent b14d1ce commit 1dd318e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scraper.py
Expand Up @@ -64,6 +64,14 @@ class SupranationalTable(WikiTable):
html = requests.get(source_url).text
soup = BeautifulSoup(html, 'html.parser')

supranational_span = soup.find('span', {'id': 'Supranational_legislatures'})
supranational_table = supranational_span.parent.find_next('table')

SupranationalTable(supranational_table).store_data(
keys=('Organisation', 'Name of house'),
id_keys=('Organisation', 'Name of house'),
)

un_members_title_span = soup.find('span', {'id': 'Legislatures_of_UN_member_states'})
un_members_table = un_members_title_span.parent.find_next('table')

Expand All @@ -72,10 +80,10 @@ class SupranationalTable(WikiTable):
id_keys=('Country', 'Name of house'),
)

supranational_span = soup.find('span', {'id': 'Supranational_legislatures'})
supranational_table = supranational_span.parent.find_next('table')
other_assembly_span = soup.find('span', {'id': 'Legislatures_of_non-sovereign_countries.2C_dependencies_and_other_territories'})
other_assembly_table = other_assembly_span.parent.find_next('table')

SupranationalTable(supranational_table).store_data(
keys=('Organisation', 'Name of house'),
id_keys=('Organisation', 'Name of house'),
OtherAssemblyTable(other_assembly_table).store_data(
keys=('Country', 'Name of house'),
id_keys=('Country', 'Name of house'),
)

0 comments on commit 1dd318e

Please sign in to comment.