Skip to content

Commit

Permalink
Merge branch 'ak-4digits'
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst committed Nov 9, 2016
2 parents 0d55e45 + adc3571 commit 5113075
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion openstates/ak/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,19 @@ def scrape(self, chamber, session):

for abbr in bill_abbrs:
bill_type = bill_types[abbr[1:]]
bill_list_url = ('http://www.legis.state.ak.us/basis/range_multi'
# We need to include 4 digit bill numbers for some bill types
# But the search engine throws an error for other other types.
if abbr in ['HB','HR','SB','SR']:
bill_list_url = ('http://www.legis.state.ak.us/basis/range_multi'
'.asp?session=%s&bill1=%s1&bill2=%s9999' %
(session, abbr, abbr)
)
else:
bill_list_url = ('http://www.legis.state.ak.us/basis/range_multi'
'.asp?session=%s&bill1=%s1&bill2=%s999' %
(session, abbr, abbr)
)

doc = lxml.html.fromstring(self.get(bill_list_url).text)
doc.make_links_absolute(bill_list_url)
for bill_link in doc.xpath('//table[@align="center"]//tr/td[1]//a'):
Expand Down

0 comments on commit 5113075

Please sign in to comment.