diff --git a/openstates/wv/__init__.py b/openstates/wv/__init__.py index faccc4e05c..1baa3c6a92 100644 --- a/openstates/wv/__init__.py +++ b/openstates/wv/__init__.py @@ -26,7 +26,7 @@ }, {'name': '2015-2016', 'start_year': 2015, 'end_year': 2016, - 'sessions': ['2015', '2016'], + 'sessions': ['2015', '2016', '20161S'], } ], 'session_details': { @@ -48,6 +48,11 @@ '2016': {'display_name': '2016 Regular Session', '_scraped_name': '2016' }, + '20161S': {'display_name': '2016 First Special Session', + '_scraped_name': '2016', + 'type':'special', + '_special_name': '1X' + }, }, 'feature_flags': ['subjects', 'influenceexplorer'], '_ignored_scraped_sessions': [ diff --git a/openstates/wv/bills.py b/openstates/wv/bills.py index 978f4c33b4..daee0bd8ea 100644 --- a/openstates/wv/bills.py +++ b/openstates/wv/bills.py @@ -51,9 +51,18 @@ def scrape(self, chamber, session): orig = 's' # scrape bills - url = ("http://www.legis.state.wv.us/Bill_Status/" + if (self.metadata['session_details'][session]['type'] == 'special'): + url = ("http://www.legis.state.wv.us/Bill_Status/" + "Bills_all_bills.cfm?year=%s&sessiontype=%s" + "&btype=bill&orig=%s" + % (self.metadata['session_details'][session]['_scraped_name'], + self.metadata['session_details'][session]['_special_name'], + orig)) + else: + url = ("http://www.legis.state.wv.us/Bill_Status/" "Bills_all_bills.cfm?year=%s&sessiontype=RS" "&btype=bill&orig=%s" % (session, orig)) + page = lxml.html.fromstring(self.get(url).text) page.make_links_absolute(url) @@ -67,8 +76,14 @@ def scrape(self, chamber, session): link.attrib['href']) # scrape resolutions - res_url = ("http://www.legis.state.wv.us/Bill_Status/res_list.cfm?" - "year=%s&sessiontype=rs&btype=res") % session + if (self.metadata['session_details'][session]['type'] == 'special'): + res_url = ("http://www.legis.state.wv.us/Bill_Status/res_list.cfm?year=%s&sessiontype=%s&btype=res" + % (self.metadata['session_details'][session]['_scraped_name'], + self.metadata['session_details'][session]['_special_name'])) + else: + res_url = ("http://www.legis.state.wv.us/Bill_Status/res_list.cfm?year=%s&sessiontype=rs&btype=res" + % (self.metadata['session_details'][session]['_scraped_name'])) + doc = lxml.html.fromstring(self.get(res_url).text) doc.make_links_absolute(res_url)