Skip to content

Commit

Permalink
Added UT special sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst committed Sep 15, 2016
1 parent ca44014 commit aae55d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 15 additions & 2 deletions openstates/ut/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'name': '2015-2016',
'start_year': 2015,
'end_year': 2016,
'sessions': ['2015', '2015s1', '2016'],
'sessions': ['2015', '2015s1', '2016', '2016S2', '2016S3'],
},
],
'session_details': {
Expand Down Expand Up @@ -110,7 +110,20 @@
'start_date': datetime.date(2016, 1, 25),
'display_name': '2016 General Session',
'_scraped_name': '2016 General Session',
}
},
#Note: There is no 2016s1, it's 2015s1
'2016S2': {
'type': 'special',
'start_date': datetime.date(2016, 1, 25),
'display_name': '2016 2nd Special Session',
'_scraped_name': '2016 2nd Special Session',
},
'2016S3': {
'type': 'special',
'start_date': datetime.date(2016, 1, 25),
'display_name': '2016 3rd Special Session',
'_scraped_name': '2016 3rd Special Session',
}
},
'feature_flags': ['events', 'subjects', 'influenceexplorer'],
'_ignored_scraped_sessions': [
Expand Down
8 changes: 7 additions & 1 deletion openstates/ut/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ def scrape(self, session, chambers):
session_search_text = session
if "s" not in session.lower() and "h" not in session.lower():
session_search_text += "GS"


print session_search_text

sessions = sessions.xpath(
'//p/a[contains(@href, "{}")]'.format(session_search_text))

session_url = ''

print sessions

for elem in sessions:

print re.sub(r'\s+', " ", elem.xpath('text()')[0])
if re.sub(r'\s+', " ", elem.xpath('text()')[0]) == \
self.metadata['session_details'][session]['_scraped_name']:
session_url = elem.xpath('@href')[0]
Expand Down

0 comments on commit aae55d8

Please sign in to comment.