diff --git a/scraper.py b/scraper.py index 002a76b..e364a83 100644 --- a/scraper.py +++ b/scraper.py @@ -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') @@ -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'), )