Skip to content

Commit

Permalink
Fixed fiscal note and related bill parsing in UT
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst committed Nov 22, 2016
1 parent b167e13 commit 9b741e5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions openstates/ut/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def scrape(self, session, chambers):
# Identify the index page for the given session
sessions = self.lxmlize(
'http://le.utah.gov/Documents/bills.htm')

session_search_text = session
if "s" not in session.lower() and "h" not in session.lower():
session_search_text += "GS"
Expand Down Expand Up @@ -135,9 +136,14 @@ def scrape_bill(self, chamber, session, bill_id, url):
mimetype='application/pdf'
)

for fiscal_link in page.xpath(
"//input[contains(@value, 'fnotes') and not(contains(@value, ';'))]/@value"):
bill.add_document("Fiscal Note", fiscal_link)
for related in page.xpath(
'//b[text()="Related Documents "]/following-sibling::ul/li/a[contains(@class,"nlink")]'):
href = related.xpath('@href')[0]
if '.fn.pdf' in href:
bill.add_document("Fiscal Note", href, mimetype='application/pdf')
else:
text = related.xpath('text()')[0]
bill.add_document(text, href, mimetype='application/pdf')

subjects = []
for link in page.xpath("//a[contains(@href, 'RelatedBill')]"):
Expand Down

0 comments on commit 9b741e5

Please sign in to comment.