Skip to content

Commit

Permalink
Cosponsors with no HREF no longer break bill parser
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst committed Dec 13, 2016
1 parent 4bbb2c1 commit 53cf955
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions openstates/mo/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,11 @@ def _parse_senate_cosponsors(self, bill, url):

# they give us a link to the congressperson, so we might
# as well keep it.
cosponsor_url = cosponsor_row.attrib['href']

bill.add_sponsor('cosponsor', cosponsor, sponsor_link=cosponsor_url)
if cosponsor_row.attrib.has_key('href'):
cosponsor_url = cosponsor_row.attrib['href']
bill.add_sponsor('cosponsor', cosponsor, sponsor_link=cosponsor_url)
else:
bill.add_sponsor('cosponsor', cosponsor)

def _scrape_house_subjects(self, session):
self.info('Collecting subject tags from lower house.')
Expand Down

0 comments on commit 53cf955

Please sign in to comment.