Skip to content

Commit

Permalink
fixed some chicago scraper data format bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rshorey committed Apr 7, 2015
1 parent ad207a2 commit b0687ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion chicago/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ def scrape(self):

def extractVotes(self, action_detail_url) :
action_detail_page = self.lxmlize(action_detail_url)
vote_table = action_detail_page.xpath("//table[@id='ctl00_ContentPlaceHolder1_gridVote_ctl00']")[0]
try:
vote_table = action_detail_page.xpath("//table[@id='ctl00_ContentPlaceHolder1_gridVote_ctl00']")[0]
except IndexError:
self.warning("No votes found in table")
return None, []
votes = list(self.parseDataTable(vote_table))
vote_list = []
for vote, _, _ in votes :
Expand Down Expand Up @@ -249,6 +253,7 @@ def addDetails(self, bill, detail_url) :
'Published in Special Pamphlet' : None,
'Adopted as Substitute' : None,
'Deferred and Published' : None,
'Approved as Amended' : 'passage',
}

VOTE_OPTIONS = {'yea' : 'yes',
Expand Down

0 comments on commit b0687ee

Please sign in to comment.